var Z0=Object.defineProperty;var ap=r=>{throw TypeError(r)};var ex=(r,t,s)=>t in r?Z0(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s;var De=(r,t,s)=>ex(r,typeof t!="symbol"?t+"":t,s),Mu=(r,t,s)=>t.has(r)||ap("Cannot "+s);var R=(r,t,s)=>(Mu(r,t,"read from private field"),s?s.call(r):t.get(r)),pe=(r,t,s)=>t.has(r)?ap("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),ee=(r,t,s,o)=>(Mu(r,t,"write to private field"),o?o.call(r,s):t.set(r,s),s),Ne=(r,t,s)=>(Mu(r,t,"access private method"),s);var pa=(r,t,s,o)=>({set _(l){ee(r,t,l,s)},get _(){return R(r,t,o)}});function tx(r,t){for(var s=0;so[l]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(l){if(l.ep)return;l.ep=!0;const u=s(l);fetch(l.href,u)}})();function Uc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Uu={exports:{}},Ao={},zu={exports:{}},Ce={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lp;function nx(){if(lp)return Ce;lp=1;var r=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.iterator;function k(N){return N===null||typeof N!="object"?null:(N=x&&N[x]||N["@@iterator"],typeof N=="function"?N:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,S={};function w(N,z,ce){this.props=N,this.context=z,this.refs=S,this.updater=ce||A}w.prototype.isReactComponent={},w.prototype.setState=function(N,z){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,z,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function b(){}b.prototype=w.prototype;function D(N,z,ce){this.props=N,this.context=z,this.refs=S,this.updater=ce||A}var O=D.prototype=new b;O.constructor=D,M(O,w.prototype),O.isPureReactComponent=!0;var j=Array.isArray,W=Object.prototype.hasOwnProperty,$={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function B(N,z,ce){var me,he={},X=null,ve=null;if(z!=null)for(me in z.ref!==void 0&&(ve=z.ref),z.key!==void 0&&(X=""+z.key),z)W.call(z,me)&&!G.hasOwnProperty(me)&&(he[me]=z[me]);var Re=arguments.length-2;if(Re===1)he.children=ce;else if(1>>1,z=K[N];if(0>>1;Nl(he,U))Xl(ve,he)?(K[N]=ve,K[X]=U,N=X):(K[N]=he,K[me]=U,N=me);else if(Xl(ve,U))K[N]=ve,K[X]=U,N=X;else break e}}return ae}function l(K,ae){var U=K.sortIndex-ae.sortIndex;return U!==0?U:K.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var d=Date,h=d.now();r.unstable_now=function(){return d.now()-h}}var m=[],g=[],v=1,x=null,k=3,A=!1,M=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(K){for(var ae=s(g);ae!==null;){if(ae.callback===null)o(g);else if(ae.startTime<=K)o(g),ae.sortIndex=ae.expirationTime,t(m,ae);else break;ae=s(g)}}function j(K){if(S=!1,O(K),!M)if(s(m)!==null)M=!0,be(W);else{var ae=s(g);ae!==null&&_e(j,ae.startTime-K)}}function W(K,ae){M=!1,S&&(S=!1,b(B),B=-1),A=!0;var U=k;try{for(O(ae),x=s(m);x!==null&&(!(x.expirationTime>ae)||K&&!Ee());){var N=x.callback;if(typeof N=="function"){x.callback=null,k=x.priorityLevel;var z=N(x.expirationTime<=ae);ae=r.unstable_now(),typeof z=="function"?x.callback=z:x===s(m)&&o(m),O(ae)}else o(m);x=s(m)}if(x!==null)var ce=!0;else{var me=s(g);me!==null&&_e(j,me.startTime-ae),ce=!1}return ce}finally{x=null,k=U,A=!1}}var $=!1,G=null,B=-1,ie=5,ue=-1;function Ee(){return!(r.unstable_now()-ueK||125N?(K.sortIndex=U,t(g,K),s(m)===null&&K===s(g)&&(S?(b(B),B=-1):S=!0,_e(j,U-N))):(K.sortIndex=z,t(m,K),M||A||(M=!0,be(W))),K},r.unstable_shouldYield=Ee,r.unstable_wrapCallback=function(K){var ae=k;return function(){var U=k;k=ae;try{return K.apply(this,arguments)}finally{k=U}}}})(Vu)),Vu}var hp;function ix(){return hp||(hp=1,$u.exports=ox()),$u.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var pp;function ax(){if(pp)return Rt;pp=1;var r=zc(),t=ix();function s(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},x={};function k(e){return m.call(x,e)?!0:m.call(v,e)?!1:g.test(e)?x[e]=!0:(v[e]=!0,!1)}function A(e,n,i,a){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return a?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function M(e,n,i,a){if(n===null||typeof n>"u"||A(e,n,i,a))return!0;if(a)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function S(e,n,i,a,c,f,y){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=a,this.attributeNamespace=c,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=f,this.removeEmptyString=y}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){w[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];w[n]=new S(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){w[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){w[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){w[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){w[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){w[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){w[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){w[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function D(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(b,D);w[n]=new S(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(b,D);w[n]=new S(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(b,D);w[n]=new S(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){w[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),w.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){w[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function O(e,n,i,a){var c=w.hasOwnProperty(n)?w[n]:null;(c!==null?c.type!==0:a||!(2E||c[y]!==f[E]){var _=` `+c[y].replace(" at new "," at ");return e.displayName&&_.includes("")&&(_=_.replace("",e.displayName)),_}while(1<=y&&0<=E);break}}}finally{ce=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?z(e):""}function he(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=me(e.type,!1),e;case 11:return e=me(e.type.render,!1),e;case 1:return e=me(e.type,!0),e;default:return""}}function X(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case $:return"Portal";case ie:return"Profiler";case B:return"StrictMode";case we:return"Suspense";case J:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ee:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case Te:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Se:return n=e.displayName||null,n!==null?n:X(e.type)||"Memo";case be:n=e._payload,e=e._init;try{return X(e(n))}catch{}}return null}function ve(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X(n);case 8:return n===B?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function Re(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ye(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function et(e){var n=ye(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),a=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,f=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(y){a=""+y,f.call(this,y)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ft(e){e._valueTracker||(e._valueTracker=et(e))}function ot(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),a="";return e&&(a=ye(e)?e.checked?"true":"false":e.value),e=a,e!==i?(n.setValue(e),!0):!1}function Gt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Mt(e,n){var i=n.checked;return U({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function Ut(e,n){var i=n.defaultValue==null?"":n.defaultValue,a=n.checked!=null?n.checked:n.defaultChecked;i=Re(n.value!=null?n.value:i),e._wrapperState={initialChecked:a,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function xe(e,n){n=n.checked,n!=null&&O(e,"checked",n,!1)}function it(e,n){xe(e,n);var i=Re(n.value),a=n.type;if(i!=null)a==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Yt(e,n.type,i):n.hasOwnProperty("defaultValue")&&Yt(e,n.type,Re(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Xt(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var a=n.type;if(!(a!=="submit"&&a!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Yt(e,n,i){(n!=="number"||Gt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Fn=Array.isArray;function Mn(e,n,i,a){if(e=e.options,n){n={};for(var c=0;c"+n.valueOf().toString()+"",n=ii.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Qs(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var Ks={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rv=["Webkit","ms","Moz","O"];Object.keys(Ks).forEach(function(e){rv.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Ks[n]=Ks[e]})});function Ed(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||Ks.hasOwnProperty(e)&&Ks[e]?(""+n).trim():n+"px"}function bd(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var a=i.indexOf("--")===0,c=Ed(i,n[i],a);i==="float"&&(i="cssFloat"),a?e.setProperty(i,c):e[i]=c}}var sv=U({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Xa(e,n){if(n){if(sv[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(s(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(s(61))}if(n.style!=null&&typeof n.style!="object")throw Error(s(62))}}function Ya(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ja=null;function Za(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var el=null,ns=null,rs=null;function Sd(e){if(e=yo(e)){if(typeof el!="function")throw Error(s(280));var n=e.stateNode;n&&(n=Ni(n),el(e.stateNode,e.type,n))}}function _d(e){ns?rs?rs.push(e):rs=[e]:ns=e}function kd(){if(ns){var e=ns,n=rs;if(rs=ns=null,Sd(e),n)for(e=0;e>>=0,e===0?32:31-(mv(e)/gv|0)|0}var di=64,fi=4194304;function Js(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hi(e,n){var i=e.pendingLanes;if(i===0)return 0;var a=0,c=e.suspendedLanes,f=e.pingedLanes,y=i&268435455;if(y!==0){var E=y&~c;E!==0?a=Js(E):(f&=y,f!==0&&(a=Js(f)))}else y=i&~c,y!==0?a=Js(y):f!==0&&(a=Js(f));if(a===0)return 0;if(n!==0&&n!==a&&(n&c)===0&&(c=a&-a,f=n&-n,c>=f||c===16&&(f&4194240)!==0))return n;if((a&4)!==0&&(a|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=a;0i;i++)n.push(e);return n}function Zs(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Jt(n),e[n]=i}function wv(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0=ao),Zd=" ",ef=!1;function tf(e,n){switch(e){case"keyup":return Kv.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var is=!1;function Xv(e,n){switch(e){case"compositionend":return nf(n);case"keypress":return n.which!==32?null:(ef=!0,Zd);case"textInput":return e=n.data,e===Zd&&ef?null:e;default:return null}}function Yv(e,n){if(is)return e==="compositionend"||!vl&&tf(e,n)?(e=Qd(),vi=fl=Vn=null,is=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:i,offset:n-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=cf(i)}}function ff(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ff(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function hf(){for(var e=window,n=Gt();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=Gt(e.document)}return n}function El(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function i0(e){var n=hf(),i=e.focusedElem,a=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&ff(i.ownerDocument.documentElement,i)){if(a!==null&&El(i)){if(n=a.start,e=a.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var c=i.textContent.length,f=Math.min(a.start,c);a=a.end===void 0?f:Math.min(a.end,c),!e.extend&&f>a&&(c=a,a=f,f=c),c=df(i,f);var y=df(i,a);c&&y&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(n=n.createRange(),n.setStart(c.node,c.offset),e.removeAllRanges(),f>a?(e.addRange(n),e.extend(y.node,y.offset)):(n.setEnd(y.node,y.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i=document.documentMode,as=null,bl=null,fo=null,Sl=!1;function pf(e,n,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Sl||as==null||as!==Gt(a)||(a=as,"selectionStart"in a&&El(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),fo&&co(fo,a)||(fo=a,a=Ci(bl,"onSelect"),0fs||(e.current=Ll[fs],Ll[fs]=null,fs--)}function Me(e,n){fs++,Ll[fs]=e.current,e.current=n}var Qn={},ft=Hn(Qn),bt=Hn(!1),Sr=Qn;function hs(e,n){var i=e.type.contextTypes;if(!i)return Qn;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===n)return a.__reactInternalMemoizedMaskedChildContext;var c={},f;for(f in i)c[f]=n[f];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=c),c}function St(e){return e=e.childContextTypes,e!=null}function Pi(){ze(bt),ze(ft)}function Nf(e,n,i){if(ft.current!==Qn)throw Error(s(168));Me(ft,n),Me(bt,i)}function Pf(e,n,i){var a=e.stateNode;if(n=n.childContextTypes,typeof a.getChildContext!="function")return i;a=a.getChildContext();for(var c in a)if(!(c in n))throw Error(s(108,ve(e)||"Unknown",c));return U({},i,a)}function Oi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,Sr=ft.current,Me(ft,e),Me(bt,bt.current),!0}function Of(e,n,i){var a=e.stateNode;if(!a)throw Error(s(169));i?(e=Pf(e,n,Sr),a.__reactInternalMemoizedMergedChildContext=e,ze(bt),ze(ft),Me(ft,e)):ze(bt),Me(bt,i)}var kn=null,Ai=!1,Il=!1;function Af(e){kn===null?kn=[e]:kn.push(e)}function v0(e){Ai=!0,Af(e)}function Kn(){if(!Il&&kn!==null){Il=!0;var e=0,n=Ie;try{var i=kn;for(Ie=1;e>=y,c-=y,Cn=1<<32-Jt(n)+c|i<ge?(rt=fe,fe=null):rt=fe.sibling;var je=V(L,fe,I[ge],Q);if(je===null){fe===null&&(fe=rt);break}e&&fe&&je.alternate===null&&n(L,fe),T=f(je,T,ge),de===null?le=je:de.sibling=je,de=je,fe=rt}if(ge===I.length)return i(L,fe),Be&&kr(L,ge),le;if(fe===null){for(;gege?(rt=fe,fe=null):rt=fe.sibling;var rr=V(L,fe,je.value,Q);if(rr===null){fe===null&&(fe=rt);break}e&&fe&&rr.alternate===null&&n(L,fe),T=f(rr,T,ge),de===null?le=rr:de.sibling=rr,de=rr,fe=rt}if(je.done)return i(L,fe),Be&&kr(L,ge),le;if(fe===null){for(;!je.done;ge++,je=I.next())je=H(L,je.value,Q),je!==null&&(T=f(je,T,ge),de===null?le=je:de.sibling=je,de=je);return Be&&kr(L,ge),le}for(fe=a(L,fe);!je.done;ge++,je=I.next())je=Z(fe,L,ge,je.value,Q),je!==null&&(e&&je.alternate!==null&&fe.delete(je.key===null?ge:je.key),T=f(je,T,ge),de===null?le=je:de.sibling=je,de=je);return e&&fe.forEach(function(J0){return n(L,J0)}),Be&&kr(L,ge),le}function Qe(L,T,I,Q){if(typeof I=="object"&&I!==null&&I.type===G&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case W:e:{for(var le=I.key,de=T;de!==null;){if(de.key===le){if(le=I.type,le===G){if(de.tag===7){i(L,de.sibling),T=c(de,I.props.children),T.return=L,L=T;break e}}else if(de.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===be&&Mf(le)===de.type){i(L,de.sibling),T=c(de,I.props),T.ref=vo(L,de,I),T.return=L,L=T;break e}i(L,de);break}else n(L,de);de=de.sibling}I.type===G?(T=jr(I.props.children,L.mode,Q,I.key),T.return=L,L=T):(Q=ia(I.type,I.key,I.props,null,L.mode,Q),Q.ref=vo(L,T,I),Q.return=L,L=Q)}return y(L);case $:e:{for(de=I.key;T!==null;){if(T.key===de)if(T.tag===4&&T.stateNode.containerInfo===I.containerInfo&&T.stateNode.implementation===I.implementation){i(L,T.sibling),T=c(T,I.children||[]),T.return=L,L=T;break e}else{i(L,T);break}else n(L,T);T=T.sibling}T=ju(I,L.mode,Q),T.return=L,L=T}return y(L);case be:return de=I._init,Qe(L,T,de(I._payload),Q)}if(Fn(I))return ne(L,T,I,Q);if(ae(I))return oe(L,T,I,Q);Ii(L,I)}return typeof I=="string"&&I!==""||typeof I=="number"?(I=""+I,T!==null&&T.tag===6?(i(L,T.sibling),T=c(T,I),T.return=L,L=T):(i(L,T),T=Au(I,L.mode,Q),T.return=L,L=T),y(L)):i(L,T)}return Qe}var ys=Uf(!0),zf=Uf(!1),Fi=Hn(null),Mi=null,vs=null,$l=null;function Vl(){$l=vs=Mi=null}function Wl(e){var n=Fi.current;ze(Fi),e._currentValue=n}function ql(e,n,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,a!==null&&(a.childLanes|=n)):a!==null&&(a.childLanes&n)!==n&&(a.childLanes|=n),e===i)break;e=e.return}}function xs(e,n){Mi=e,$l=vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(_t=!0),e.firstContext=null)}function $t(e){var n=e._currentValue;if($l!==e)if(e={context:e,memoizedValue:n,next:null},vs===null){if(Mi===null)throw Error(s(308));vs=e,Mi.dependencies={lanes:0,firstContext:e}}else vs=vs.next=e;return n}var Cr=null;function Hl(e){Cr===null?Cr=[e]:Cr.push(e)}function Bf(e,n,i,a){var c=n.interleaved;return c===null?(i.next=i,Hl(n)):(i.next=c.next,c.next=i),n.interleaved=i,Tn(e,a)}function Tn(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Gn=!1;function Ql(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $f(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Nn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Xn(e,n,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ae&2)!==0){var c=a.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n,Tn(e,i)}return c=a.interleaved,c===null?(n.next=n,Hl(a)):(n.next=c.next,c.next=n),a.interleaved=n,Tn(e,i)}function Ui(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,al(e,i)}}function Vf(e,n){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var c=null,f=null;if(i=i.firstBaseUpdate,i!==null){do{var y={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};f===null?c=f=y:f=f.next=y,i=i.next}while(i!==null);f===null?c=f=n:f=f.next=n}else c=f=n;i={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:a.shared,effects:a.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function zi(e,n,i,a){var c=e.updateQueue;Gn=!1;var f=c.firstBaseUpdate,y=c.lastBaseUpdate,E=c.shared.pending;if(E!==null){c.shared.pending=null;var _=E,F=_.next;_.next=null,y===null?f=F:y.next=F,y=_;var q=e.alternate;q!==null&&(q=q.updateQueue,E=q.lastBaseUpdate,E!==y&&(E===null?q.firstBaseUpdate=F:E.next=F,q.lastBaseUpdate=_))}if(f!==null){var H=c.baseState;y=0,q=F=_=null,E=f;do{var V=E.lane,Z=E.eventTime;if((a&V)===V){q!==null&&(q=q.next={eventTime:Z,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var ne=e,oe=E;switch(V=n,Z=i,oe.tag){case 1:if(ne=oe.payload,typeof ne=="function"){H=ne.call(Z,H,V);break e}H=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=oe.payload,V=typeof ne=="function"?ne.call(Z,H,V):ne,V==null)break e;H=U({},H,V);break e;case 2:Gn=!0}}E.callback!==null&&E.lane!==0&&(e.flags|=64,V=c.effects,V===null?c.effects=[E]:V.push(E))}else Z={eventTime:Z,lane:V,tag:E.tag,payload:E.payload,callback:E.callback,next:null},q===null?(F=q=Z,_=H):q=q.next=Z,y|=V;if(E=E.next,E===null){if(E=c.shared.pending,E===null)break;V=E,E=V.next,V.next=null,c.lastBaseUpdate=V,c.shared.pending=null}}while(!0);if(q===null&&(_=H),c.baseState=_,c.firstBaseUpdate=F,c.lastBaseUpdate=q,n=c.shared.interleaved,n!==null){c=n;do y|=c.lane,c=c.next;while(c!==n)}else f===null&&(c.shared.lanes=0);Nr|=y,e.lanes=y,e.memoizedState=H}}function Wf(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;ni?i:4,e(!0);var a=Jl.transition;Jl.transition={};try{e(!1),n()}finally{Ie=i,Jl.transition=a}}function uh(){return Vt().memoizedState}function b0(e,n,i){var a=er(e);if(i={lane:a,action:i,hasEagerState:!1,eagerState:null,next:null},ch(e))dh(n,i);else if(i=Bf(e,n,i,a),i!==null){var c=wt();sn(i,e,a,c),fh(i,n,a)}}function S0(e,n,i){var a=er(e),c={lane:a,action:i,hasEagerState:!1,eagerState:null,next:null};if(ch(e))dh(n,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,E=f(y,i);if(c.hasEagerState=!0,c.eagerState=E,Zt(E,y)){var _=n.interleaved;_===null?(c.next=c,Hl(n)):(c.next=_.next,_.next=c),n.interleaved=c;return}}catch{}finally{}i=Bf(e,n,c,a),i!==null&&(c=wt(),sn(i,e,a,c),fh(i,n,a))}}function ch(e){var n=e.alternate;return e===Ve||n!==null&&n===Ve}function dh(e,n){bo=Vi=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function fh(e,n,i){if((i&4194240)!==0){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,al(e,i)}}var Hi={readContext:$t,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useInsertionEffect:ht,useLayoutEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useMutableSource:ht,useSyncExternalStore:ht,useId:ht,unstable_isNewReconciler:!1},_0={readContext:$t,useCallback:function(e,n){return pn().memoizedState=[e,n===void 0?null:n],e},useContext:$t,useEffect:th,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,Wi(4194308,4,sh.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Wi(4194308,4,e,n)},useInsertionEffect:function(e,n){return Wi(4,2,e,n)},useMemo:function(e,n){var i=pn();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var a=pn();return n=i!==void 0?i(n):n,a.memoizedState=a.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=b0.bind(null,Ve,e),[a.memoizedState,e]},useRef:function(e){var n=pn();return e={current:e},n.memoizedState=e},useState:Zf,useDebugValue:ou,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=Zf(!1),n=e[0];return e=E0.bind(null,e[1]),pn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var a=Ve,c=pn();if(Be){if(i===void 0)throw Error(s(407));i=i()}else{if(i=n(),nt===null)throw Error(s(349));(Tr&30)!==0||Kf(a,n,i)}c.memoizedState=i;var f={value:i,getSnapshot:n};return c.queue=f,th(Xf.bind(null,a,f,e),[e]),a.flags|=2048,ko(9,Gf.bind(null,a,f,i,n),void 0,null),i},useId:function(){var e=pn(),n=nt.identifierPrefix;if(Be){var i=Rn,a=Cn;i=(a&~(1<<32-Jt(a)-1)).toString(32)+i,n=":"+n+"R"+i,i=So++,0<\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=y.createElement(i,{is:a.is}):(e=y.createElement(i),i==="select"&&(y=e,a.multiple?y.multiple=!0:a.size&&(y.size=a.size))):e=y.createElementNS(e,i),e[fn]=n,e[go]=a,Ah(e,n,!1,!1),n.stateNode=e;e:{switch(y=Ya(i,a),i){case"dialog":Ue("cancel",e),Ue("close",e),c=a;break;case"iframe":case"object":case"embed":Ue("load",e),c=a;break;case"video":case"audio":for(c=0;c_s&&(n.flags|=128,a=!0,Co(f,!1),n.lanes=4194304)}else{if(!a)if(e=Bi(y),e!==null){if(n.flags|=128,a=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Co(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Be)return pt(n),null}else 2*He()-f.renderingStartTime>_s&&i!==1073741824&&(n.flags|=128,a=!0,Co(f,!1),n.lanes=4194304);f.isBackwards?(y.sibling=n.child,n.child=y):(i=f.last,i!==null?i.sibling=y:n.child=y,f.last=y)}return f.tail!==null?(n=f.tail,f.rendering=n,f.tail=n.sibling,f.renderingStartTime=He(),n.sibling=null,i=$e.current,Me($e,a?i&1|2:i&1),n):(pt(n),null);case 22:case 23:return Nu(),a=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(n.flags|=8192),a&&(n.mode&1)!==0?(Lt&1073741824)!==0&&(pt(n),n.subtreeFlags&6&&(n.flags|=8192)):pt(n),null;case 24:return null;case 25:return null}throw Error(s(156,n.tag))}function A0(e,n){switch(Ml(n),n.tag){case 1:return St(n.type)&&Pi(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ws(),ze(bt),ze(ft),Yl(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Gl(n),null;case 13:if(ze($e),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));gs()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ze($e),null;case 4:return ws(),null;case 10:return Wl(n.type._context),null;case 22:case 23:return Nu(),null;case 24:return null;default:return null}}var Xi=!1,mt=!1,j0=typeof WeakSet=="function"?WeakSet:Set,te=null;function bs(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(a){We(e,n,a)}else i.current=null}function yu(e,n,i){try{i()}catch(a){We(e,n,a)}}var Lh=!1;function D0(e,n){if(Nl=gi,e=hf(),El(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var a=i.getSelection&&i.getSelection();if(a&&a.rangeCount!==0){i=a.anchorNode;var c=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{i.nodeType,f.nodeType}catch{i=null;break e}var y=0,E=-1,_=-1,F=0,q=0,H=e,V=null;t:for(;;){for(var Z;H!==i||c!==0&&H.nodeType!==3||(E=y+c),H!==f||a!==0&&H.nodeType!==3||(_=y+a),H.nodeType===3&&(y+=H.nodeValue.length),(Z=H.firstChild)!==null;)V=H,H=Z;for(;;){if(H===e)break t;if(V===i&&++F===c&&(E=y),V===f&&++q===a&&(_=y),(Z=H.nextSibling)!==null)break;H=V,V=H.parentNode}H=Z}i=E===-1||_===-1?null:{start:E,end:_}}else i=null}i=i||{start:0,end:0}}else i=null;for(Pl={focusedElem:e,selectionRange:i},gi=!1,te=n;te!==null;)if(n=te,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,te=e;else for(;te!==null;){n=te;try{var ne=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ne!==null){var oe=ne.memoizedProps,Qe=ne.memoizedState,L=n.stateNode,T=L.getSnapshotBeforeUpdate(n.elementType===n.type?oe:tn(n.type,oe),Qe);L.__reactInternalSnapshotBeforeUpdate=T}break;case 3:var I=n.stateNode.containerInfo;I.nodeType===1?I.textContent="":I.nodeType===9&&I.documentElement&&I.removeChild(I.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(Q){We(n,n.return,Q)}if(e=n.sibling,e!==null){e.return=n.return,te=e;break}te=n.return}return ne=Lh,Lh=!1,ne}function Ro(e,n,i){var a=n.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var c=a=a.next;do{if((c.tag&e)===e){var f=c.destroy;c.destroy=void 0,f!==void 0&&yu(n,i,f)}c=c.next}while(c!==a)}}function Yi(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.create;i.destroy=a()}i=i.next}while(i!==n)}}function vu(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function Ih(e){var n=e.alternate;n!==null&&(e.alternate=null,Ih(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[fn],delete n[go],delete n[Dl],delete n[g0],delete n[y0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Fh(e){return e.tag===5||e.tag===3||e.tag===4}function Mh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xu(e,n,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Ti));else if(a!==4&&(e=e.child,e!==null))for(xu(e,n,i),e=e.sibling;e!==null;)xu(e,n,i),e=e.sibling}function wu(e,n,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(wu(e,n,i),e=e.sibling;e!==null;)wu(e,n,i),e=e.sibling}var at=null,nn=!1;function Yn(e,n,i){for(i=i.child;i!==null;)Uh(e,n,i),i=i.sibling}function Uh(e,n,i){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount(ci,i)}catch{}switch(i.tag){case 5:mt||bs(i,n);case 6:var a=at,c=nn;at=null,Yn(e,n,i),at=a,nn=c,at!==null&&(nn?(e=at,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):at.removeChild(i.stateNode));break;case 18:at!==null&&(nn?(e=at,i=i.stateNode,e.nodeType===8?jl(e.parentNode,i):e.nodeType===1&&jl(e,i),so(e)):jl(at,i.stateNode));break;case 4:a=at,c=nn,at=i.stateNode.containerInfo,nn=!0,Yn(e,n,i),at=a,nn=c;break;case 0:case 11:case 14:case 15:if(!mt&&(a=i.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){c=a=a.next;do{var f=c,y=f.destroy;f=f.tag,y!==void 0&&((f&2)!==0||(f&4)!==0)&&yu(i,n,y),c=c.next}while(c!==a)}Yn(e,n,i);break;case 1:if(!mt&&(bs(i,n),a=i.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=i.memoizedProps,a.state=i.memoizedState,a.componentWillUnmount()}catch(E){We(i,n,E)}Yn(e,n,i);break;case 21:Yn(e,n,i);break;case 22:i.mode&1?(mt=(a=mt)||i.memoizedState!==null,Yn(e,n,i),mt=a):Yn(e,n,i);break;default:Yn(e,n,i)}}function zh(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new j0),n.forEach(function(a){var c=V0.bind(null,e,a);i.has(a)||(i.add(a),a.then(c,c))})}}function rn(e,n){var i=n.deletions;if(i!==null)for(var a=0;ac&&(c=y),a&=~f}if(a=c,a=He()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*I0(a/1960))-a,10e?16:e,Zn===null)var a=!1;else{if(e=Zn,Zn=null,na=0,(Ae&6)!==0)throw Error(s(331));var c=Ae;for(Ae|=4,te=e.current;te!==null;){var f=te,y=f.child;if((te.flags&16)!==0){var E=f.deletions;if(E!==null){for(var _=0;_He()-Su?Or(e,0):bu|=i),Ct(e,n)}function Zh(e,n){n===0&&((e.mode&1)===0?n=1:(n=fi,fi<<=1,(fi&130023424)===0&&(fi=4194304)));var i=wt();e=Tn(e,n),e!==null&&(Zs(e,n,i),Ct(e,i))}function $0(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Zh(e,i)}function V0(e,n){var i=0;switch(e.tag){case 13:var a=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(s(314))}a!==null&&a.delete(n),Zh(e,i)}var ep;ep=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||bt.current)_t=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return _t=!1,P0(e,n,i);_t=(e.flags&131072)!==0}else _t=!1,Be&&(n.flags&1048576)!==0&&jf(n,Di,n.index);switch(n.lanes=0,n.tag){case 2:var a=n.type;Gi(e,n),e=n.pendingProps;var c=hs(n,ft.current);xs(n,i),c=eu(null,n,a,e,c,i);var f=tu();return n.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,St(a)?(f=!0,Oi(n)):f=!1,n.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Ql(n),c.updater=Qi,n.stateNode=c,c._reactInternals=n,au(n,a,e,i),n=du(null,n,a,!0,f,i)):(n.tag=0,Be&&f&&Fl(n),xt(null,n,c,i),n=n.child),n;case 16:a=n.elementType;e:{switch(Gi(e,n),e=n.pendingProps,c=a._init,a=c(a._payload),n.type=a,c=n.tag=q0(a),e=tn(a,e),c){case 0:n=cu(null,n,a,e,i);break e;case 1:n=Ch(null,n,a,e,i);break e;case 11:n=Eh(null,n,a,e,i);break e;case 14:n=bh(null,n,a,tn(a.type,e),i);break e}throw Error(s(306,a,""))}return n;case 0:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:tn(a,c),cu(e,n,a,c,i);case 1:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:tn(a,c),Ch(e,n,a,c,i);case 3:e:{if(Rh(n),e===null)throw Error(s(387));a=n.pendingProps,f=n.memoizedState,c=f.element,$f(e,n),zi(n,a,null,i);var y=n.memoizedState;if(a=y.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){c=Es(Error(s(423)),n),n=Th(e,n,a,i,c);break e}else if(a!==c){c=Es(Error(s(424)),n),n=Th(e,n,a,i,c);break e}else for(Dt=qn(n.stateNode.containerInfo.firstChild),jt=n,Be=!0,en=null,i=zf(n,null,a,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(gs(),a===c){n=Pn(e,n,i);break e}xt(e,n,a,i)}n=n.child}return n;case 5:return qf(n),e===null&&zl(n),a=n.type,c=n.pendingProps,f=e!==null?e.memoizedProps:null,y=c.children,Ol(a,c)?y=null:f!==null&&Ol(a,f)&&(n.flags|=32),kh(e,n),xt(e,n,y,i),n.child;case 6:return e===null&&zl(n),null;case 13:return Nh(e,n,i);case 4:return Kl(n,n.stateNode.containerInfo),a=n.pendingProps,e===null?n.child=ys(n,null,a,i):xt(e,n,a,i),n.child;case 11:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:tn(a,c),Eh(e,n,a,c,i);case 7:return xt(e,n,n.pendingProps,i),n.child;case 8:return xt(e,n,n.pendingProps.children,i),n.child;case 12:return xt(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(a=n.type._context,c=n.pendingProps,f=n.memoizedProps,y=c.value,Me(Fi,a._currentValue),a._currentValue=y,f!==null)if(Zt(f.value,y)){if(f.children===c.children&&!bt.current){n=Pn(e,n,i);break e}}else for(f=n.child,f!==null&&(f.return=n);f!==null;){var E=f.dependencies;if(E!==null){y=f.child;for(var _=E.firstContext;_!==null;){if(_.context===a){if(f.tag===1){_=Nn(-1,i&-i),_.tag=2;var F=f.updateQueue;if(F!==null){F=F.shared;var q=F.pending;q===null?_.next=_:(_.next=q.next,q.next=_),F.pending=_}}f.lanes|=i,_=f.alternate,_!==null&&(_.lanes|=i),ql(f.return,i,n),E.lanes|=i;break}_=_.next}}else if(f.tag===10)y=f.type===n.type?null:f.child;else if(f.tag===18){if(y=f.return,y===null)throw Error(s(341));y.lanes|=i,E=y.alternate,E!==null&&(E.lanes|=i),ql(y,i,n),y=f.sibling}else y=f.child;if(y!==null)y.return=f;else for(y=f;y!==null;){if(y===n){y=null;break}if(f=y.sibling,f!==null){f.return=y.return,y=f;break}y=y.return}f=y}xt(e,n,c.children,i),n=n.child}return n;case 9:return c=n.type,a=n.pendingProps.children,xs(n,i),c=$t(c),a=a(c),n.flags|=1,xt(e,n,a,i),n.child;case 14:return a=n.type,c=tn(a,n.pendingProps),c=tn(a.type,c),bh(e,n,a,c,i);case 15:return Sh(e,n,n.type,n.pendingProps,i);case 17:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:tn(a,c),Gi(e,n),n.tag=1,St(a)?(e=!0,Oi(n)):e=!1,xs(n,i),ph(n,a,c),au(n,a,c,i),du(null,n,a,!0,e,i);case 19:return Oh(e,n,i);case 22:return _h(e,n,i)}throw Error(s(156,n.tag))};function tp(e,n){return jd(e,n)}function W0(e,n,i,a){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,n,i,a){return new W0(e,n,i,a)}function Ou(e){return e=e.prototype,!(!e||!e.isReactComponent)}function q0(e){if(typeof e=="function")return Ou(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Te)return 11;if(e===Se)return 14}return 2}function nr(e,n){var i=e.alternate;return i===null?(i=qt(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function ia(e,n,i,a,c,f){var y=2;if(a=e,typeof e=="function")Ou(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case G:return jr(i.children,c,f,n);case B:y=8,c|=8;break;case ie:return e=qt(12,i,n,c|2),e.elementType=ie,e.lanes=f,e;case we:return e=qt(13,i,n,c),e.elementType=we,e.lanes=f,e;case J:return e=qt(19,i,n,c),e.elementType=J,e.lanes=f,e;case _e:return aa(i,c,f,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:y=10;break e;case Ee:y=9;break e;case Te:y=11;break e;case Se:y=14;break e;case be:y=16,a=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return n=qt(y,i,n,c),n.elementType=e,n.type=a,n.lanes=f,n}function jr(e,n,i,a){return e=qt(7,e,a,n),e.lanes=i,e}function aa(e,n,i,a){return e=qt(22,e,a,n),e.elementType=_e,e.lanes=i,e.stateNode={isHidden:!1},e}function Au(e,n,i){return e=qt(6,e,null,n),e.lanes=i,e}function ju(e,n,i){return n=qt(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function H0(e,n,i,a,c){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=il(0),this.expirationTimes=il(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=il(0),this.identifierPrefix=a,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Du(e,n,i,a,c,f,y,E,_){return e=new H0(e,n,i,E,_),n===1?(n=1,f===!0&&(n|=8)):n=0,f=qt(3,null,null,n),e.current=f,f.stateNode=e,f.memoizedState={element:a,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ql(f),e}function Q0(e,n,i){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),Bu.exports=ax(),Bu.exports}var gp;function lx(){if(gp)return ma;gp=1;var r=Xm();return ma.createRoot=r.createRoot,ma.hydrateRoot=r.hydrateRoot,ma}var ux=lx();const cx=Uc(ux),dx=20,fx=1e6,In={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let Wu=0;function hx(){return Wu=(Wu+1)%Number.MAX_VALUE,Wu.toString()}const qu=new Map,yp=r=>{if(qu.has(r))return;const t=setTimeout(()=>{qu.delete(r),$o({type:In.REMOVE_TOAST,toastId:r})},fx);qu.set(r,t)},px=(r,t)=>{switch(t.type){case In.ADD_TOAST:return{...r,toasts:[t.toast,...r.toasts].slice(0,dx)};case In.UPDATE_TOAST:return{...r,toasts:r.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case In.DISMISS_TOAST:{const{toastId:s}=t;return s?yp(s):r.toasts.forEach(o=>{yp(o.id)}),{...r,toasts:r.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o)}}case In.REMOVE_TOAST:return t.toastId===void 0?{...r,toasts:[]}:{...r,toasts:r.toasts.filter(s=>s.id!==t.toastId)}}},ka=[];let Ca={toasts:[]};function $o(r){Ca=px(Ca,r),ka.forEach(t=>{t(Ca)})}function mx({...r}){const t=hx(),s=l=>$o({type:In.UPDATE_TOAST,toast:{...l,id:t}}),o=()=>$o({type:In.DISMISS_TOAST,toastId:t});return $o({type:In.ADD_TOAST,toast:{...r,id:t,open:!0,onOpenChange:l=>{l||o()}}}),{id:t,dismiss:o,update:s}}function gx(){const[r,t]=C.useState(Ca);return C.useEffect(()=>(ka.push(t),()=>{const s=ka.indexOf(t);s>-1&&ka.splice(s,1)}),[r]),{...r,toast:mx,dismiss:s=>$o({type:In.DISMISS_TOAST,toastId:s})}}var Bc=Xm();const yx=Uc(Bc);function It(r,t,{checkForDefaultPrevented:s=!0}={}){return function(l){if(r==null||r(l),s===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function vp(r,t){if(typeof r=="function")return r(t);r!=null&&(r.current=t)}function $c(...r){return t=>{let s=!1;const o=r.map(l=>{const u=vp(l,t);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let l=0;l{var b;const{scope:k,children:A,...M}=x,S=((b=k==null?void 0:k[r])==null?void 0:b[m])||h,w=C.useMemo(()=>M,Object.values(M));return p.jsx(S.Provider,{value:w,children:A})};g.displayName=u+"Provider";function v(x,k){var S;const A=((S=k==null?void 0:k[r])==null?void 0:S[m])||h,M=C.useContext(A);if(M)return M;if(d!==void 0)return d;throw new Error(`\`${x}\` must be used within \`${u}\``)}return[g,v]}const l=()=>{const u=s.map(d=>C.createContext(d));return function(h){const m=(h==null?void 0:h[r])||u;return C.useMemo(()=>({[`__scope${r}`]:{...h,[r]:m}}),[h,m])}};return l.scopeName=r,[o,vx(l,...t)]}function vx(...r){const t=r[0];if(r.length===1)return t;const s=()=>{const o=r.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const d=o.reduce((h,{useScope:m,scopeName:g})=>{const x=m(u)[`__scope${g}`];return{...h,...x}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}function xp(r){const t=xx(r),s=C.forwardRef((o,l)=>{const{children:u,...d}=o,h=C.Children.toArray(u),m=h.find(Ex);if(m){const g=m.props.children,v=h.map(x=>x===m?C.Children.count(g)>1?C.Children.only(null):C.isValidElement(g)?g.props.children:null:x);return p.jsx(t,{...d,ref:l,children:C.isValidElement(g)?C.cloneElement(g,void 0,v):null})}return p.jsx(t,{...d,ref:l,children:u})});return s.displayName=`${r}.Slot`,s}function xx(r){const t=C.forwardRef((s,o)=>{const{children:l,...u}=s;if(C.isValidElement(l)){const d=Sx(l),h=bx(u,l.props);return l.type!==C.Fragment&&(h.ref=o?$c(o,d):d),C.cloneElement(l,h)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${r}.SlotClone`,t}var wx=Symbol("radix.slottable");function Ex(r){return C.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===wx}function bx(r,t){const s={...t};for(const o in t){const l=r[o],u=t[o];/^on[A-Z]/.test(o)?l&&u?s[o]=(...h)=>{const m=u(...h);return l(...h),m}:l&&(s[o]=l):o==="style"?s[o]={...l,...u}:o==="className"&&(s[o]=[l,u].filter(Boolean).join(" "))}return{...r,...s}}function Sx(r){var o,l;let t=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?r.ref:(t=(l=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?r.props.ref:r.props.ref||r.ref)}function _x(r){const t=r+"CollectionProvider",[s,o]=Ym(t),[l,u]=s(t,{collectionRef:{current:null},itemMap:new Map}),d=S=>{const{scope:w,children:b}=S,D=ir.useRef(null),O=ir.useRef(new Map).current;return p.jsx(l,{scope:w,itemMap:O,collectionRef:D,children:b})};d.displayName=t;const h=r+"CollectionSlot",m=xp(h),g=ir.forwardRef((S,w)=>{const{scope:b,children:D}=S,O=u(h,b),j=Xr(w,O.collectionRef);return p.jsx(m,{ref:j,children:D})});g.displayName=h;const v=r+"CollectionItemSlot",x="data-radix-collection-item",k=xp(v),A=ir.forwardRef((S,w)=>{const{scope:b,children:D,...O}=S,j=ir.useRef(null),W=Xr(w,j),$=u(v,b);return ir.useEffect(()=>($.itemMap.set(j,{ref:j,...O}),()=>void $.itemMap.delete(j))),p.jsx(k,{[x]:"",ref:W,children:D})});A.displayName=v;function M(S){const w=u(r+"CollectionConsumer",S);return ir.useCallback(()=>{const D=w.collectionRef.current;if(!D)return[];const O=Array.from(D.querySelectorAll(`[${x}]`));return Array.from(w.itemMap.values()).sort(($,G)=>O.indexOf($.ref.current)-O.indexOf(G.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:d,Slot:g,ItemSlot:A},M,o]}function kx(r){const t=Cx(r),s=C.forwardRef((o,l)=>{const{children:u,...d}=o,h=C.Children.toArray(u),m=h.find(Tx);if(m){const g=m.props.children,v=h.map(x=>x===m?C.Children.count(g)>1?C.Children.only(null):C.isValidElement(g)?g.props.children:null:x);return p.jsx(t,{...d,ref:l,children:C.isValidElement(g)?C.cloneElement(g,void 0,v):null})}return p.jsx(t,{...d,ref:l,children:u})});return s.displayName=`${r}.Slot`,s}function Cx(r){const t=C.forwardRef((s,o)=>{const{children:l,...u}=s;if(C.isValidElement(l)){const d=Px(l),h=Nx(u,l.props);return l.type!==C.Fragment&&(h.ref=o?$c(o,d):d),C.cloneElement(l,h)}return C.Children.count(l)>1?C.Children.only(null):null});return t.displayName=`${r}.SlotClone`,t}var Rx=Symbol("radix.slottable");function Tx(r){return C.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Rx}function Nx(r,t){const s={...t};for(const o in t){const l=r[o],u=t[o];/^on[A-Z]/.test(o)?l&&u?s[o]=(...h)=>{const m=u(...h);return l(...h),m}:l&&(s[o]=l):o==="style"?s[o]={...l,...u}:o==="className"&&(s[o]=[l,u].filter(Boolean).join(" "))}return{...r,...s}}function Px(r){var o,l;let t=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?r.ref:(t=(l=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?r.props.ref:r.props.ref||r.ref)}var Ox=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bn=Ox.reduce((r,t)=>{const s=kx(`Primitive.${t}`),o=C.forwardRef((l,u)=>{const{asChild:d,...h}=l,m=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(m,{...h,ref:u})});return o.displayName=`Primitive.${t}`,{...r,[t]:o}},{});function Jm(r,t){r&&Bc.flushSync(()=>r.dispatchEvent(t))}function Yr(r){const t=C.useRef(r);return C.useEffect(()=>{t.current=r}),C.useMemo(()=>(...s)=>{var o;return(o=t.current)==null?void 0:o.call(t,...s)},[])}function Ax(r,t=globalThis==null?void 0:globalThis.document){const s=Yr(r);C.useEffect(()=>{const o=l=>{l.key==="Escape"&&s(l)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[s,t])}var jx="DismissableLayer",ic="dismissableLayer.update",Dx="dismissableLayer.pointerDownOutside",Lx="dismissableLayer.focusOutside",wp,Zm=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eg=C.forwardRef((r,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:h,...m}=r,g=C.useContext(Zm),[v,x]=C.useState(null),k=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,A]=C.useState({}),M=Xr(t,G=>x(G)),S=Array.from(g.layers),[w]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),b=S.indexOf(w),D=v?S.indexOf(v):-1,O=g.layersWithOutsidePointerEventsDisabled.size>0,j=D>=b,W=Fx(G=>{const B=G.target,ie=[...g.branches].some(ue=>ue.contains(B));!j||ie||(l==null||l(G),d==null||d(G),G.defaultPrevented||h==null||h())},k),$=Mx(G=>{const B=G.target;[...g.branches].some(ue=>ue.contains(B))||(u==null||u(G),d==null||d(G),G.defaultPrevented||h==null||h())},k);return Ax(G=>{D===g.layers.size-1&&(o==null||o(G),!G.defaultPrevented&&h&&(G.preventDefault(),h()))},k),C.useEffect(()=>{if(v)return s&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(wp=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),Ep(),()=>{s&&g.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=wp)}},[v,k,s,g]),C.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),Ep())},[v,g]),C.useEffect(()=>{const G=()=>A({});return document.addEventListener(ic,G),()=>document.removeEventListener(ic,G)},[]),p.jsx(bn.div,{...m,ref:M,style:{pointerEvents:O?j?"auto":"none":void 0,...r.style},onFocusCapture:It(r.onFocusCapture,$.onFocusCapture),onBlurCapture:It(r.onBlurCapture,$.onBlurCapture),onPointerDownCapture:It(r.onPointerDownCapture,W.onPointerDownCapture)})});eg.displayName=jx;var Ix="DismissableLayerBranch",tg=C.forwardRef((r,t)=>{const s=C.useContext(Zm),o=C.useRef(null),l=Xr(t,o);return C.useEffect(()=>{const u=o.current;if(u)return s.branches.add(u),()=>{s.branches.delete(u)}},[s.branches]),p.jsx(bn.div,{...r,ref:l})});tg.displayName=Ix;function Fx(r,t=globalThis==null?void 0:globalThis.document){const s=Yr(r),o=C.useRef(!1),l=C.useRef(()=>{});return C.useEffect(()=>{const u=h=>{if(h.target&&!o.current){let m=function(){ng(Dx,s,g,{discrete:!0})};const g={originalEvent:h};h.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);o.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",u),t.removeEventListener("click",l.current)}},[t,s]),{onPointerDownCapture:()=>o.current=!0}}function Mx(r,t=globalThis==null?void 0:globalThis.document){const s=Yr(r),o=C.useRef(!1);return C.useEffect(()=>{const l=u=>{u.target&&!o.current&&ng(Lx,s,{originalEvent:u},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,s]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ep(){const r=new CustomEvent(ic);document.dispatchEvent(r)}function ng(r,t,s,{discrete:o}){const l=s.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:s});t&&l.addEventListener(r,t,{once:!0}),o?Jm(l,u):l.dispatchEvent(u)}var Ux=eg,zx=tg,Wo=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},Bx="Portal",rg=C.forwardRef((r,t)=>{var h;const{container:s,...o}=r,[l,u]=C.useState(!1);Wo(()=>u(!0),[]);const d=s||l&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return d?yx.createPortal(p.jsx(bn.div,{...o,ref:t}),d):null});rg.displayName=Bx;function $x(r,t){return C.useReducer((s,o)=>t[s][o]??s,r)}var sg=r=>{const{present:t,children:s}=r,o=Vx(t),l=typeof s=="function"?s({present:o.isPresent}):C.Children.only(s),u=Xr(o.ref,Wx(l));return typeof s=="function"||o.isPresent?C.cloneElement(l,{ref:u}):null};sg.displayName="Presence";function Vx(r){const[t,s]=C.useState(),o=C.useRef(null),l=C.useRef(r),u=C.useRef("none"),d=r?"mounted":"unmounted",[h,m]=$x(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const g=ga(o.current);u.current=h==="mounted"?g:"none"},[h]),Wo(()=>{const g=o.current,v=l.current;if(v!==r){const k=u.current,A=ga(g);r?m("MOUNT"):A==="none"||(g==null?void 0:g.display)==="none"?m("UNMOUNT"):m(v&&k!==A?"ANIMATION_OUT":"UNMOUNT"),l.current=r}},[r,m]),Wo(()=>{if(t){let g;const v=t.ownerDocument.defaultView??window,x=A=>{const S=ga(o.current).includes(CSS.escape(A.animationName));if(A.target===t&&S&&(m("ANIMATION_END"),!l.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",g=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},k=A=>{A.target===t&&(u.current=ga(o.current))};return t.addEventListener("animationstart",k),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{v.clearTimeout(g),t.removeEventListener("animationstart",k),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:C.useCallback(g=>{o.current=g?getComputedStyle(g):null,s(g)},[])}}function ga(r){return(r==null?void 0:r.animationName)||"none"}function Wx(r){var o,l;let t=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?r.ref:(t=(l=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:l.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?r.props.ref:r.props.ref||r.ref)}var qx=Gm[" useInsertionEffect ".trim().toString()]||Wo;function Hx({prop:r,defaultProp:t,onChange:s=()=>{},caller:o}){const[l,u,d]=Qx({defaultProp:t,onChange:s}),h=r!==void 0,m=h?r:l;{const v=C.useRef(r!==void 0);C.useEffect(()=>{const x=v.current;x!==h&&console.warn(`${o} is changing from ${x?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=h},[h,o])}const g=C.useCallback(v=>{var x;if(h){const k=Kx(v)?v(r):v;k!==r&&((x=d.current)==null||x.call(d,k))}else u(v)},[h,r,u,d]);return[m,g]}function Qx({defaultProp:r,onChange:t}){const[s,o]=C.useState(r),l=C.useRef(s),u=C.useRef(t);return qx(()=>{u.current=t},[t]),C.useEffect(()=>{var d;l.current!==s&&((d=u.current)==null||d.call(u,s),l.current=s)},[s,l]),[s,o,u]}function Kx(r){return typeof r=="function"}var Gx=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Xx="VisuallyHidden",Vc=C.forwardRef((r,t)=>p.jsx(bn.span,{...r,ref:t,style:{...Gx,...r.style}}));Vc.displayName=Xx;var Wc="ToastProvider",[qc,Yx,Jx]=_x("Toast"),[og]=Ym("Toast",[Jx]),[Zx,Ba]=og(Wc),ig=r=>{const{__scopeToast:t,label:s="Notification",duration:o=5e3,swipeDirection:l="right",swipeThreshold:u=50,children:d}=r,[h,m]=C.useState(null),[g,v]=C.useState(0),x=C.useRef(!1),k=C.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${Wc}\`. Expected non-empty \`string\`.`),p.jsx(qc.Provider,{scope:t,children:p.jsx(Zx,{scope:t,label:s,duration:o,swipeDirection:l,swipeThreshold:u,toastCount:g,viewport:h,onViewportChange:m,onToastAdd:C.useCallback(()=>v(A=>A+1),[]),onToastRemove:C.useCallback(()=>v(A=>A-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:k,children:d})})};ig.displayName=Wc;var ag="ToastViewport",ew=["F8"],ac="toast.viewportPause",lc="toast.viewportResume",lg=C.forwardRef((r,t)=>{const{__scopeToast:s,hotkey:o=ew,label:l="Notifications ({hotkey})",...u}=r,d=Ba(ag,s),h=Yx(s),m=C.useRef(null),g=C.useRef(null),v=C.useRef(null),x=C.useRef(null),k=Xr(t,x,d.onViewportChange),A=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=d.toastCount>0;C.useEffect(()=>{const w=b=>{var O;o.length!==0&&o.every(j=>b[j]||b.code===j)&&((O=x.current)==null||O.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[o]),C.useEffect(()=>{const w=m.current,b=x.current;if(M&&w&&b){const D=()=>{if(!d.isClosePausedRef.current){const $=new CustomEvent(ac);b.dispatchEvent($),d.isClosePausedRef.current=!0}},O=()=>{if(d.isClosePausedRef.current){const $=new CustomEvent(lc);b.dispatchEvent($),d.isClosePausedRef.current=!1}},j=$=>{!w.contains($.relatedTarget)&&O()},W=()=>{w.contains(document.activeElement)||O()};return w.addEventListener("focusin",D),w.addEventListener("focusout",j),w.addEventListener("pointermove",D),w.addEventListener("pointerleave",W),window.addEventListener("blur",D),window.addEventListener("focus",O),()=>{w.removeEventListener("focusin",D),w.removeEventListener("focusout",j),w.removeEventListener("pointermove",D),w.removeEventListener("pointerleave",W),window.removeEventListener("blur",D),window.removeEventListener("focus",O)}}},[M,d.isClosePausedRef]);const S=C.useCallback(({tabbingDirection:w})=>{const D=h().map(O=>{const j=O.ref.current,W=[j,...hw(j)];return w==="forwards"?W:W.reverse()});return(w==="forwards"?D.reverse():D).flat()},[h]);return C.useEffect(()=>{const w=x.current;if(w){const b=D=>{var W,$,G;const O=D.altKey||D.ctrlKey||D.metaKey;if(D.key==="Tab"&&!O){const B=document.activeElement,ie=D.shiftKey;if(D.target===w&&ie){(W=g.current)==null||W.focus();return}const Te=S({tabbingDirection:ie?"backwards":"forwards"}),we=Te.findIndex(J=>J===B);Hu(Te.slice(we+1))?D.preventDefault():ie?($=g.current)==null||$.focus():(G=v.current)==null||G.focus()}};return w.addEventListener("keydown",b),()=>w.removeEventListener("keydown",b)}},[h,S]),p.jsxs(zx,{ref:m,role:"region","aria-label":l.replace("{hotkey}",A),tabIndex:-1,style:{pointerEvents:M?void 0:"none"},children:[M&&p.jsx(uc,{ref:g,onFocusFromOutsideViewport:()=>{const w=S({tabbingDirection:"forwards"});Hu(w)}}),p.jsx(qc.Slot,{scope:s,children:p.jsx(bn.ol,{tabIndex:-1,...u,ref:k})}),M&&p.jsx(uc,{ref:v,onFocusFromOutsideViewport:()=>{const w=S({tabbingDirection:"backwards"});Hu(w)}})]})});lg.displayName=ag;var ug="ToastFocusProxy",uc=C.forwardRef((r,t)=>{const{__scopeToast:s,onFocusFromOutsideViewport:o,...l}=r,u=Ba(ug,s);return p.jsx(Vc,{tabIndex:0,...l,ref:t,style:{position:"fixed"},onFocus:d=>{var g;const h=d.relatedTarget;!((g=u.viewport)!=null&&g.contains(h))&&o()}})});uc.displayName=ug;var Zo="Toast",tw="toast.swipeStart",nw="toast.swipeMove",rw="toast.swipeCancel",sw="toast.swipeEnd",cg=C.forwardRef((r,t)=>{const{forceMount:s,open:o,defaultOpen:l,onOpenChange:u,...d}=r,[h,m]=Hx({prop:o,defaultProp:l??!0,onChange:u,caller:Zo});return p.jsx(sg,{present:s||h,children:p.jsx(aw,{open:h,...d,ref:t,onClose:()=>m(!1),onPause:Yr(r.onPause),onResume:Yr(r.onResume),onSwipeStart:It(r.onSwipeStart,g=>{g.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:It(r.onSwipeMove,g=>{const{x:v,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","move"),g.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${v}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:It(r.onSwipeCancel,g=>{g.currentTarget.setAttribute("data-swipe","cancel"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:It(r.onSwipeEnd,g=>{const{x:v,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","end"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${v}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),m(!1)})})})});cg.displayName=Zo;var[ow,iw]=og(Zo,{onClose(){}}),aw=C.forwardRef((r,t)=>{const{__scopeToast:s,type:o="foreground",duration:l,open:u,onClose:d,onEscapeKeyDown:h,onPause:m,onResume:g,onSwipeStart:v,onSwipeMove:x,onSwipeCancel:k,onSwipeEnd:A,...M}=r,S=Ba(Zo,s),[w,b]=C.useState(null),D=Xr(t,J=>b(J)),O=C.useRef(null),j=C.useRef(null),W=l||S.duration,$=C.useRef(0),G=C.useRef(W),B=C.useRef(0),{onToastAdd:ie,onToastRemove:ue}=S,Ee=Yr(()=>{var Se;(w==null?void 0:w.contains(document.activeElement))&&((Se=S.viewport)==null||Se.focus()),d()}),Te=C.useCallback(J=>{!J||J===1/0||(window.clearTimeout(B.current),$.current=new Date().getTime(),B.current=window.setTimeout(Ee,J))},[Ee]);C.useEffect(()=>{const J=S.viewport;if(J){const Se=()=>{Te(G.current),g==null||g()},be=()=>{const _e=new Date().getTime()-$.current;G.current=G.current-_e,window.clearTimeout(B.current),m==null||m()};return J.addEventListener(ac,be),J.addEventListener(lc,Se),()=>{J.removeEventListener(ac,be),J.removeEventListener(lc,Se)}}},[S.viewport,W,m,g,Te]),C.useEffect(()=>{u&&!S.isClosePausedRef.current&&Te(W)},[u,W,S.isClosePausedRef,Te]),C.useEffect(()=>(ie(),()=>ue()),[ie,ue]);const we=C.useMemo(()=>w?yg(w):null,[w]);return S.viewport?p.jsxs(p.Fragment,{children:[we&&p.jsx(lw,{__scopeToast:s,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:we}),p.jsx(ow,{scope:s,onClose:Ee,children:Bc.createPortal(p.jsx(qc.ItemSlot,{scope:s,children:p.jsx(Ux,{asChild:!0,onEscapeKeyDown:It(h,()=>{S.isFocusedToastEscapeKeyDownRef.current||Ee(),S.isFocusedToastEscapeKeyDownRef.current=!1}),children:p.jsx(bn.li,{tabIndex:0,"data-state":u?"open":"closed","data-swipe-direction":S.swipeDirection,...M,ref:D,style:{userSelect:"none",touchAction:"none",...r.style},onKeyDown:It(r.onKeyDown,J=>{J.key==="Escape"&&(h==null||h(J.nativeEvent),J.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,Ee()))}),onPointerDown:It(r.onPointerDown,J=>{J.button===0&&(O.current={x:J.clientX,y:J.clientY})}),onPointerMove:It(r.onPointerMove,J=>{if(!O.current)return;const Se=J.clientX-O.current.x,be=J.clientY-O.current.y,_e=!!j.current,K=["left","right"].includes(S.swipeDirection),ae=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,U=K?ae(0,Se):0,N=K?0:ae(0,be),z=J.pointerType==="touch"?10:2,ce={x:U,y:N},me={originalEvent:J,delta:ce};_e?(j.current=ce,ya(nw,x,me,{discrete:!1})):bp(ce,S.swipeDirection,z)?(j.current=ce,ya(tw,v,me,{discrete:!1}),J.target.setPointerCapture(J.pointerId)):(Math.abs(Se)>z||Math.abs(be)>z)&&(O.current=null)}),onPointerUp:It(r.onPointerUp,J=>{const Se=j.current,be=J.target;if(be.hasPointerCapture(J.pointerId)&&be.releasePointerCapture(J.pointerId),j.current=null,O.current=null,Se){const _e=J.currentTarget,K={originalEvent:J,delta:Se};bp(Se,S.swipeDirection,S.swipeThreshold)?ya(sw,A,K,{discrete:!0}):ya(rw,k,K,{discrete:!0}),_e.addEventListener("click",ae=>ae.preventDefault(),{once:!0})}})})})}),S.viewport)})]}):null}),lw=r=>{const{__scopeToast:t,children:s,...o}=r,l=Ba(Zo,t),[u,d]=C.useState(!1),[h,m]=C.useState(!1);return dw(()=>d(!0)),C.useEffect(()=>{const g=window.setTimeout(()=>m(!0),1e3);return()=>window.clearTimeout(g)},[]),h?null:p.jsx(rg,{asChild:!0,children:p.jsx(Vc,{...o,children:u&&p.jsxs(p.Fragment,{children:[l.label," ",s]})})})},uw="ToastTitle",dg=C.forwardRef((r,t)=>{const{__scopeToast:s,...o}=r;return p.jsx(bn.div,{...o,ref:t})});dg.displayName=uw;var cw="ToastDescription",fg=C.forwardRef((r,t)=>{const{__scopeToast:s,...o}=r;return p.jsx(bn.div,{...o,ref:t})});fg.displayName=cw;var hg="ToastAction",pg=C.forwardRef((r,t)=>{const{altText:s,...o}=r;return s.trim()?p.jsx(gg,{altText:s,asChild:!0,children:p.jsx(Hc,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${hg}\`. Expected non-empty \`string\`.`),null)});pg.displayName=hg;var mg="ToastClose",Hc=C.forwardRef((r,t)=>{const{__scopeToast:s,...o}=r,l=iw(mg,s);return p.jsx(gg,{asChild:!0,children:p.jsx(bn.button,{type:"button",...o,ref:t,onClick:It(r.onClick,l.onClose)})})});Hc.displayName=mg;var gg=C.forwardRef((r,t)=>{const{__scopeToast:s,altText:o,...l}=r;return p.jsx(bn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...l,ref:t})});function yg(r){const t=[];return Array.from(r.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),fw(o)){const l=o.ariaHidden||o.hidden||o.style.display==="none",u=o.dataset.radixToastAnnounceExclude==="";if(!l)if(u){const d=o.dataset.radixToastAnnounceAlt;d&&t.push(d)}else t.push(...yg(o))}}),t}function ya(r,t,s,{discrete:o}){const l=s.originalEvent.currentTarget,u=new CustomEvent(r,{bubbles:!0,cancelable:!0,detail:s});t&&l.addEventListener(r,t,{once:!0}),o?Jm(l,u):l.dispatchEvent(u)}var bp=(r,t,s=0)=>{const o=Math.abs(r.x),l=Math.abs(r.y),u=o>l;return t==="left"||t==="right"?u&&o>s:!u&&l>s};function dw(r=()=>{}){const t=Yr(r);Wo(()=>{let s=0,o=0;return s=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(o)}},[t])}function fw(r){return r.nodeType===r.ELEMENT_NODE}function hw(r){const t=[],s=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Hu(r){const t=document.activeElement;return r.some(s=>s===t?!0:(s.focus(),document.activeElement!==t))}var pw=ig,vg=lg,xg=cg,wg=dg,Eg=fg,bg=pg,Sg=Hc;function _g(r){var t,s,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var l=r.length;for(t=0;ttypeof r=="boolean"?`${r}`:r===0?"0":r,_p=kg,mw=(r,t)=>s=>{var o;if((t==null?void 0:t.variants)==null)return _p(r,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:l,defaultVariants:u}=t,d=Object.keys(l).map(g=>{const v=s==null?void 0:s[g],x=u==null?void 0:u[g];if(v===null)return null;const k=Sp(v)||Sp(x);return l[g][k]}),h=s&&Object.entries(s).reduce((g,v)=>{let[x,k]=v;return k===void 0||(g[x]=k),g},{}),m=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((g,v)=>{let{class:x,className:k,...A}=v;return Object.entries(A).every(M=>{let[S,w]=M;return Array.isArray(w)?w.includes({...u,...h}[S]):{...u,...h}[S]===w})?[...g,x,k]:g},[]);return _p(r,d,m,s==null?void 0:s.class,s==null?void 0:s.className)};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gw=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cg=(...r)=>r.filter((t,s,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===s).join(" ").trim();/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var yw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vw=C.forwardRef(({color:r="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:d,...h},m)=>C.createElement("svg",{ref:m,...yw,width:t,height:t,stroke:r,strokeWidth:o?Number(s)*24/Number(t):s,className:Cg("lucide",l),...h},[...d.map(([g,v])=>C.createElement(g,v)),...Array.isArray(u)?u:[u]]));/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xr=(r,t)=>{const s=C.forwardRef(({className:o,...l},u)=>C.createElement(vw,{ref:u,iconNode:t,className:Cg(`lucide-${gw(r)}`,o),...l}));return s.displayName=`${r}`,s};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],un=xr("ArrowRight",xw);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ww=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rg=xr("ChevronDown",ww);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ew=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Qc=xr("ExternalLink",Ew);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Sw=xr("Globe",bw);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _w=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],kw=xr("Menu",_w);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Rw=xr("Search",Cw);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tw=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Nw=xr("Settings",Tw);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kc=xr("X",Pw),Ow=(r,t)=>{const s=new Array(r.length+t.length);for(let o=0;o({classGroupId:r,validator:t}),Tg=(r=new Map,t=null,s)=>({nextPart:r,validators:t,classGroupId:s}),Da="-",kp=[],jw="arbitrary..",Dw=r=>{const t=Iw(r),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return Lw(d);const h=d.split(Da),m=h[0]===""&&h.length>1?1:0;return Ng(h,m,t)},getConflictingClassGroupIds:(d,h)=>{if(h){const m=o[d],g=s[d];return m?g?Ow(g,m):m:g||kp}return s[d]||kp}}},Ng=(r,t,s)=>{if(r.length-t===0)return s.classGroupId;const l=r[t],u=s.nextPart.get(l);if(u){const g=Ng(r,t+1,u);if(g)return g}const d=s.validators;if(d===null)return;const h=t===0?r.join(Da):r.slice(t).join(Da),m=d.length;for(let g=0;gr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=r.slice(1,-1),s=t.indexOf(":"),o=t.slice(0,s);return o?jw+o:void 0})(),Iw=r=>{const{theme:t,classGroups:s}=r;return Fw(s,t)},Fw=(r,t)=>{const s=Tg();for(const o in r){const l=r[o];Gc(l,s,o,t)}return s},Gc=(r,t,s,o)=>{const l=r.length;for(let u=0;u{if(typeof r=="string"){Uw(r,t,s);return}if(typeof r=="function"){zw(r,t,s,o);return}Bw(r,t,s,o)},Uw=(r,t,s)=>{const o=r===""?t:Pg(t,r);o.classGroupId=s},zw=(r,t,s,o)=>{if($w(r)){Gc(r(o),t,s,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Aw(s,r))},Bw=(r,t,s,o)=>{const l=Object.entries(r),u=l.length;for(let d=0;d{let s=r;const o=t.split(Da),l=o.length;for(let u=0;u"isThemeGetter"in r&&r.isThemeGetter===!0,Vw=r=>{if(r<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),o=Object.create(null);const l=(u,d)=>{s[u]=d,t++,t>r&&(t=0,o=s,s=Object.create(null))};return{get(u){let d=s[u];if(d!==void 0)return d;if((d=o[u])!==void 0)return l(u,d),d},set(u,d){u in s?s[u]=d:l(u,d)}}},cc="!",Cp=":",Ww=[],Rp=(r,t,s,o,l)=>({modifiers:r,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:o,isExternal:l}),qw=r=>{const{prefix:t,experimentalParseClassName:s}=r;let o=l=>{const u=[];let d=0,h=0,m=0,g;const v=l.length;for(let S=0;Sm?g-m:void 0;return Rp(u,A,k,M)};if(t){const l=t+Cp,u=o;o=d=>d.startsWith(l)?u(d.slice(l.length)):Rp(Ww,!1,d,void 0,!0)}if(s){const l=o;o=u=>s({className:u,parseClassName:l})}return o},Hw=r=>{const t=new Map;return r.orderSensitiveModifiers.forEach((s,o)=>{t.set(s,1e6+o)}),s=>{const o=[];let l=[];for(let u=0;u0&&(l.sort(),o.push(...l),l=[]),o.push(d)):l.push(d)}return l.length>0&&(l.sort(),o.push(...l)),o}},Qw=r=>({cache:Vw(r.cacheSize),parseClassName:qw(r),sortModifiers:Hw(r),...Dw(r)}),Kw=/\s+/,Gw=(r,t)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:u}=t,d=[],h=r.trim().split(Kw);let m="";for(let g=h.length-1;g>=0;g-=1){const v=h[g],{isExternal:x,modifiers:k,hasImportantModifier:A,baseClassName:M,maybePostfixModifierPosition:S}=s(v);if(x){m=v+(m.length>0?" "+m:m);continue}let w=!!S,b=o(w?M.substring(0,S):M);if(!b){if(!w){m=v+(m.length>0?" "+m:m);continue}if(b=o(M),!b){m=v+(m.length>0?" "+m:m);continue}w=!1}const D=k.length===0?"":k.length===1?k[0]:u(k).join(":"),O=A?D+cc:D,j=O+b;if(d.indexOf(j)>-1)continue;d.push(j);const W=l(b,w);for(let $=0;$0?" "+m:m)}return m},Xw=(...r)=>{let t=0,s,o,l="";for(;t{if(typeof r=="string")return r;let t,s="";for(let o=0;o{let s,o,l,u;const d=m=>{const g=t.reduce((v,x)=>x(v),r());return s=Qw(g),o=s.cache.get,l=s.cache.set,u=h,h(m)},h=m=>{const g=o(m);if(g)return g;const v=Gw(m,s);return l(m,v),v};return u=d,(...m)=>u(Xw(...m))},Jw=[],Ze=r=>{const t=s=>s[r]||Jw;return t.isThemeGetter=!0,t},Ag=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zw=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,e1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,n1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,s1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sr=r=>Zw.test(r),ke=r=>!!r&&!Number.isNaN(Number(r)),or=r=>!!r&&Number.isInteger(Number(r)),Qu=r=>r.endsWith("%")&&ke(r.slice(0,-1)),An=r=>e1.test(r),Dg=()=>!0,o1=r=>t1.test(r)&&!n1.test(r),Xc=()=>!1,i1=r=>r1.test(r),a1=r=>s1.test(r),l1=r=>!re(r)&&!se(r),u1=r=>wr(r,Fg,Xc),re=r=>Ag.test(r),Dr=r=>wr(r,Mg,o1),Tp=r=>wr(r,y1,ke),c1=r=>wr(r,zg,Dg),d1=r=>wr(r,Ug,Xc),Np=r=>wr(r,Lg,Xc),f1=r=>wr(r,Ig,a1),va=r=>wr(r,Bg,i1),se=r=>jg.test(r),jo=r=>ts(r,Mg),h1=r=>ts(r,Ug),Pp=r=>ts(r,Lg),p1=r=>ts(r,Fg),m1=r=>ts(r,Ig),xa=r=>ts(r,Bg,!0),g1=r=>ts(r,zg,!0),wr=(r,t,s)=>{const o=Ag.exec(r);return o?o[1]?t(o[1]):s(o[2]):!1},ts=(r,t,s=!1)=>{const o=jg.exec(r);return o?o[1]?t(o[1]):s:!1},Lg=r=>r==="position"||r==="percentage",Ig=r=>r==="image"||r==="url",Fg=r=>r==="length"||r==="size"||r==="bg-size",Mg=r=>r==="length",y1=r=>r==="number",Ug=r=>r==="family-name",zg=r=>r==="number"||r==="weight",Bg=r=>r==="shadow",v1=()=>{const r=Ze("color"),t=Ze("font"),s=Ze("text"),o=Ze("font-weight"),l=Ze("tracking"),u=Ze("leading"),d=Ze("breakpoint"),h=Ze("container"),m=Ze("spacing"),g=Ze("radius"),v=Ze("shadow"),x=Ze("inset-shadow"),k=Ze("text-shadow"),A=Ze("drop-shadow"),M=Ze("blur"),S=Ze("perspective"),w=Ze("aspect"),b=Ze("ease"),D=Ze("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...j(),se,re],$=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto","contain","none"],B=()=>[se,re,m],ie=()=>[sr,"full","auto",...B()],ue=()=>[or,"none","subgrid",se,re],Ee=()=>["auto",{span:["full",or,se,re]},or,se,re],Te=()=>[or,"auto",se,re],we=()=>["auto","min","max","fr",se,re],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Se=()=>["start","end","center","stretch","center-safe","end-safe"],be=()=>["auto",...B()],_e=()=>[sr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],K=()=>[sr,"screen","full","dvw","lvw","svw","min","max","fit",...B()],ae=()=>[sr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],U=()=>[r,se,re],N=()=>[...j(),Pp,Np,{position:[se,re]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ce=()=>["auto","cover","contain",p1,u1,{size:[se,re]}],me=()=>[Qu,jo,Dr],he=()=>["","none","full",g,se,re],X=()=>["",ke,jo,Dr],ve=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[ke,Qu,Pp,Np],et=()=>["","none",M,se,re],Ft=()=>["none",ke,se,re],ot=()=>["none",ke,se,re],Gt=()=>[ke,se,re],Mt=()=>[sr,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[An],breakpoint:[An],color:[Dg],container:[An],"drop-shadow":[An],ease:["in","out","in-out"],font:[l1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[An],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[An],shadow:[An],spacing:["px",ke],text:[An],"text-shadow":[An],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sr,re,se,w]}],container:["container"],columns:[{columns:[ke,re,se,h]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:W()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ie()}],"inset-x":[{"inset-x":ie()}],"inset-y":[{"inset-y":ie()}],start:[{"inset-s":ie(),start:ie()}],end:[{"inset-e":ie(),end:ie()}],"inset-bs":[{"inset-bs":ie()}],"inset-be":[{"inset-be":ie()}],top:[{top:ie()}],right:[{right:ie()}],bottom:[{bottom:ie()}],left:[{left:ie()}],visibility:["visible","invisible","collapse"],z:[{z:[or,"auto",se,re]}],basis:[{basis:[sr,"full","auto",h,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,sr,"auto","initial","none",re]}],grow:[{grow:["",ke,se,re]}],shrink:[{shrink:["",ke,se,re]}],order:[{order:[or,"first","last","none",se,re]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:Ee()}],"col-start":[{"col-start":Te()}],"col-end":[{"col-end":Te()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:Ee()}],"row-start":[{"row-start":Te()}],"row-end":[{"row-end":Te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":we()}],"auto-rows":[{"auto-rows":we()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...Se(),"normal"]}],"justify-self":[{"justify-self":["auto",...Se()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...Se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Se(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...Se(),"baseline"]}],"place-self":[{"place-self":["auto",...Se()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:be()}],mx:[{mx:be()}],my:[{my:be()}],ms:[{ms:be()}],me:[{me:be()}],mbs:[{mbs:be()}],mbe:[{mbe:be()}],mt:[{mt:be()}],mr:[{mr:be()}],mb:[{mb:be()}],ml:[{ml:be()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:_e()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[h,"screen",..._e()]}],"min-w":[{"min-w":[h,"screen","none",..._e()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},..._e()]}],h:[{h:["screen","lh",..._e()]}],"min-h":[{"min-h":["screen","lh","none",..._e()]}],"max-h":[{"max-h":["screen","lh",..._e()]}],"font-size":[{text:["base",s,jo,Dr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,g1,c1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qu,re]}],"font-family":[{font:[h1,d1,t]}],"font-features":[{"font-features":[re]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,se,re]}],"line-clamp":[{"line-clamp":[ke,"none",se,Tp]}],leading:[{leading:[u,...B()]}],"list-image":[{"list-image":["none",se,re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",se,Dr]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[ke,"auto",se,re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se,re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},or,se,re],radial:["",se,re],conic:[or,se,re]},m1,f1]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,se,re]}],"outline-w":[{outline:["",ke,jo,Dr]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",v,xa,va]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",x,xa,va]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[ke,Dr]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",k,xa,va]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[ke,se,re]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[se,re]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,re]}],filter:[{filter:["","none",se,re]}],blur:[{blur:et()}],brightness:[{brightness:[ke,se,re]}],contrast:[{contrast:[ke,se,re]}],"drop-shadow":[{"drop-shadow":["","none",A,xa,va]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",ke,se,re]}],"hue-rotate":[{"hue-rotate":[ke,se,re]}],invert:[{invert:["",ke,se,re]}],saturate:[{saturate:[ke,se,re]}],sepia:[{sepia:["",ke,se,re]}],"backdrop-filter":[{"backdrop-filter":["","none",se,re]}],"backdrop-blur":[{"backdrop-blur":et()}],"backdrop-brightness":[{"backdrop-brightness":[ke,se,re]}],"backdrop-contrast":[{"backdrop-contrast":[ke,se,re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,se,re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,se,re]}],"backdrop-invert":[{"backdrop-invert":["",ke,se,re]}],"backdrop-opacity":[{"backdrop-opacity":[ke,se,re]}],"backdrop-saturate":[{"backdrop-saturate":[ke,se,re]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,se,re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",se,re]}],ease:[{ease:["linear","initial",b,se,re]}],delay:[{delay:[ke,se,re]}],animate:[{animate:["none",D,se,re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,se,re]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:Ft()}],"rotate-x":[{"rotate-x":Ft()}],"rotate-y":[{"rotate-y":Ft()}],"rotate-z":[{"rotate-z":Ft()}],scale:[{scale:ot()}],"scale-x":[{"scale-x":ot()}],"scale-y":[{"scale-y":ot()}],"scale-z":[{"scale-z":ot()}],"scale-3d":["scale-3d"],skew:[{skew:Gt()}],"skew-x":[{"skew-x":Gt()}],"skew-y":[{"skew-y":Gt()}],transform:[{transform:[se,re,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Mt()}],"translate-x":[{"translate-x":Mt()}],"translate-y":[{"translate-y":Mt()}],"translate-z":[{"translate-z":Mt()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se,re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se,re]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[ke,jo,Dr,Tp]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},x1=Yw(v1);function Vs(...r){return x1(kg(r))}const w1=pw,$g=C.forwardRef(({className:r,...t},s)=>p.jsx(vg,{ref:s,className:Vs("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",r),...t}));$g.displayName=vg.displayName;const E1=mw("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Vg=C.forwardRef(({className:r,variant:t,...s},o)=>p.jsx(xg,{ref:o,className:Vs(E1({variant:t}),r),...s}));Vg.displayName=xg.displayName;const b1=C.forwardRef(({className:r,...t},s)=>p.jsx(bg,{ref:s,className:Vs("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",r),...t}));b1.displayName=bg.displayName;const Wg=C.forwardRef(({className:r,...t},s)=>p.jsx(Sg,{ref:s,className:Vs("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),"toast-close":"",...t,children:p.jsx(Kc,{className:"h-4 w-4"})}));Wg.displayName=Sg.displayName;const qg=C.forwardRef(({className:r,...t},s)=>p.jsx(wg,{ref:s,className:Vs("text-sm font-semibold",r),...t}));qg.displayName=wg.displayName;const Hg=C.forwardRef(({className:r,...t},s)=>p.jsx(Eg,{ref:s,className:Vs("text-sm opacity-90",r),...t}));Hg.displayName=Eg.displayName;function S1(){const{toasts:r}=gx();return p.jsxs(w1,{children:[r.map(function({id:t,title:s,description:o,action:l,...u}){return p.jsxs(Vg,{...u,children:[p.jsxs("div",{className:"grid gap-1",children:[s&&p.jsx(qg,{children:s}),o&&p.jsx(Hg,{children:o})]}),l,p.jsx(Wg,{})]},t)}),p.jsx($g,{})]})}var ei=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_1={setTimeout:(r,t)=>setTimeout(r,t),clearTimeout:r=>clearTimeout(r),setInterval:(r,t)=>setInterval(r,t),clearInterval:r=>clearInterval(r)},lr,Mc,Mm,k1=(Mm=class{constructor(){pe(this,lr,_1);pe(this,Mc,!1)}setTimeoutProvider(r){ee(this,lr,r)}setTimeout(r,t){return R(this,lr).setTimeout(r,t)}clearTimeout(r){R(this,lr).clearTimeout(r)}setInterval(r,t){return R(this,lr).setInterval(r,t)}clearInterval(r){R(this,lr).clearInterval(r)}},lr=new WeakMap,Mc=new WeakMap,Mm),Fr=new k1;function C1(r){setTimeout(r,0)}var Jr=typeof window>"u"||"Deno"in globalThis;function Nt(){}function R1(r,t){return typeof r=="function"?r(t):r}function dc(r){return typeof r=="number"&&r>=0&&r!==1/0}function Qg(r,t){return Math.max(r+(t||0)-Date.now(),0)}function yr(r,t){return typeof r=="function"?r(t):r}function Qt(r,t){return typeof r=="function"?r(t):r}function Op(r,t){const{type:s="all",exact:o,fetchStatus:l,predicate:u,queryKey:d,stale:h}=r;if(d){if(o){if(t.queryHash!==Yc(d,t.options))return!1}else if(!Ho(t.queryKey,d))return!1}if(s!=="all"){const m=t.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof h=="boolean"&&t.isStale()!==h||l&&l!==t.state.fetchStatus||u&&!u(t))}function Ap(r,t){const{exact:s,status:o,predicate:l,mutationKey:u}=r;if(u){if(!t.options.mutationKey)return!1;if(s){if(qo(t.options.mutationKey)!==qo(u))return!1}else if(!Ho(t.options.mutationKey,u))return!1}return!(o&&t.state.status!==o||l&&!l(t))}function Yc(r,t){return((t==null?void 0:t.queryKeyHashFn)||qo)(r)}function qo(r){return JSON.stringify(r,(t,s)=>hc(s)?Object.keys(s).sort().reduce((o,l)=>(o[l]=s[l],o),{}):s)}function Ho(r,t){return r===t?!0:typeof r!=typeof t?!1:r&&t&&typeof r=="object"&&typeof t=="object"?Object.keys(t).every(s=>Ho(r[s],t[s])):!1}var T1=Object.prototype.hasOwnProperty;function Kg(r,t,s=0){if(r===t)return r;if(s>500)return t;const o=jp(r)&&jp(t);if(!o&&!(hc(r)&&hc(t)))return t;const u=(o?r:Object.keys(r)).length,d=o?t:Object.keys(t),h=d.length,m=o?new Array(h):{};let g=0;for(let v=0;v{Fr.setTimeout(t,r)})}function pc(r,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(r,t):s.structuralSharing!==!1?Kg(r,t):t}function P1(r,t,s=0){const o=[...r,t];return s&&o.length>s?o.slice(1):o}function O1(r,t,s=0){const o=[t,...r];return s&&o.length>s?o.slice(0,-1):o}var Jc=Symbol();function Gg(r,t){return!r.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!r.queryFn||r.queryFn===Jc?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function Xg(r,t){return typeof r=="function"?r(...t):!!r}function A1(r,t,s){let o=!1,l;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(l??(l=t()),o||(o=!0,l.aborted?s():l.addEventListener("abort",s,{once:!0})),l)}),r}var Ur,ur,Ns,Um,j1=(Um=class extends ei{constructor(){super();pe(this,Ur);pe(this,ur);pe(this,Ns);ee(this,Ns,t=>{if(!Jr&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){R(this,ur)||this.setEventListener(R(this,Ns))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,ur))==null||t.call(this),ee(this,ur,void 0))}setEventListener(t){var s;ee(this,Ns,t),(s=R(this,ur))==null||s.call(this),ee(this,ur,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(t){R(this,Ur)!==t&&(ee(this,Ur,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof R(this,Ur)=="boolean"?R(this,Ur):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ur=new WeakMap,ur=new WeakMap,Ns=new WeakMap,Um),Zc=new j1;function mc(){let r,t;const s=new Promise((l,u)=>{r=l,t=u});s.status="pending",s.catch(()=>{});function o(l){Object.assign(s,l),delete s.resolve,delete s.reject}return s.resolve=l=>{o({status:"fulfilled",value:l}),r(l)},s.reject=l=>{o({status:"rejected",reason:l}),t(l)},s}var D1=C1;function L1(){let r=[],t=0,s=h=>{h()},o=h=>{h()},l=D1;const u=h=>{t?r.push(h):l(()=>{s(h)})},d=()=>{const h=r;r=[],h.length&&l(()=>{o(()=>{h.forEach(m=>{s(m)})})})};return{batch:h=>{let m;t++;try{m=h()}finally{t--,t||d()}return m},batchCalls:h=>(...m)=>{u(()=>{h(...m)})},schedule:u,setNotifyFunction:h=>{s=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{l=h}}}var ct=L1(),Ps,cr,Os,zm,I1=(zm=class extends ei{constructor(){super();pe(this,Ps,!0);pe(this,cr);pe(this,Os);ee(this,Os,t=>{if(!Jr&&window.addEventListener){const s=()=>t(!0),o=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}})}onSubscribe(){R(this,cr)||this.setEventListener(R(this,Os))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,cr))==null||t.call(this),ee(this,cr,void 0))}setEventListener(t){var s;ee(this,Os,t),(s=R(this,cr))==null||s.call(this),ee(this,cr,t(this.setOnline.bind(this)))}setOnline(t){R(this,Ps)!==t&&(ee(this,Ps,t),this.listeners.forEach(o=>{o(t)}))}isOnline(){return R(this,Ps)}},Ps=new WeakMap,cr=new WeakMap,Os=new WeakMap,zm),La=new I1;function F1(r){return Math.min(1e3*2**r,3e4)}function Yg(r){return(r??"online")==="online"?La.isOnline():!0}var gc=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function Jg(r){let t=!1,s=0,o;const l=mc(),u=()=>l.status!=="pending",d=S=>{var w;if(!u()){const b=new gc(S);k(b),(w=r.onCancel)==null||w.call(r,b)}},h=()=>{t=!0},m=()=>{t=!1},g=()=>Zc.isFocused()&&(r.networkMode==="always"||La.isOnline())&&r.canRun(),v=()=>Yg(r.networkMode)&&r.canRun(),x=S=>{u()||(o==null||o(),l.resolve(S))},k=S=>{u()||(o==null||o(),l.reject(S))},A=()=>new Promise(S=>{var w;o=b=>{(u()||g())&&S(b)},(w=r.onPause)==null||w.call(r)}).then(()=>{var S;o=void 0,u()||(S=r.onContinue)==null||S.call(r)}),M=()=>{if(u())return;let S;const w=s===0?r.initialPromise:void 0;try{S=w??r.fn()}catch(b){S=Promise.reject(b)}Promise.resolve(S).then(x).catch(b=>{var $;if(u())return;const D=r.retry??(Jr?0:3),O=r.retryDelay??F1,j=typeof O=="function"?O(s,b):O,W=D===!0||typeof D=="number"&&sg()?void 0:A()).then(()=>{t?k(b):M()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(o==null||o(),l),cancelRetry:h,continueRetry:m,canStart:v,start:()=>(v()?M():A().then(M),l)}}var zr,Bm,Zg=(Bm=class{constructor(){pe(this,zr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dc(this.gcTime)&&ee(this,zr,Fr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(Jr?1/0:300*1e3))}clearGcTimeout(){R(this,zr)&&(Fr.clearTimeout(R(this,zr)),ee(this,zr,void 0))}},zr=new WeakMap,Bm),Br,As,Ht,$r,st,Ko,Vr,on,jn,$m,M1=($m=class extends Zg{constructor(t){super();pe(this,on);pe(this,Br);pe(this,As);pe(this,Ht);pe(this,$r);pe(this,st);pe(this,Ko);pe(this,Vr);ee(this,Vr,!1),ee(this,Ko,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,$r,t.client),ee(this,Ht,R(this,$r).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,Br,Ip(this.options)),this.state=t.state??R(this,Br),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=R(this,st))==null?void 0:t.promise}setOptions(t){if(this.options={...R(this,Ko),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Ip(this.options);s.data!==void 0&&(this.setState(Lp(s.data,s.dataUpdatedAt)),ee(this,Br,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,Ht).remove(this)}setData(t,s){const o=pc(this.state.data,t,this.options);return Ne(this,on,jn).call(this,{data:o,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),o}setState(t,s){Ne(this,on,jn).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var o,l;const s=(o=R(this,st))==null?void 0:o.promise;return(l=R(this,st))==null||l.cancel(t),s?s.then(Nt).catch(Nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(R(this,Br))}isActive(){return this.observers.some(t=>Qt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Jc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>yr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Qg(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(o=>o.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=R(this,st))==null||s.continue()}onOnline(){var s;const t=this.observers.find(o=>o.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=R(this,st))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),R(this,Ht).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(R(this,st)&&(R(this,Vr)?R(this,st).cancel({revert:!0}):R(this,st).cancelRetry()),this.scheduleGc()),R(this,Ht).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ne(this,on,jn).call(this,{type:"invalidate"})}async fetch(t,s){var m,g,v,x,k,A,M,S,w,b,D,O;if(this.state.fetchStatus!=="idle"&&((m=R(this,st))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(R(this,st))return R(this,st).continueRetry(),R(this,st).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(W=>W.options.queryFn);j&&this.setOptions(j.options)}const o=new AbortController,l=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(ee(this,Vr,!0),o.signal)})},u=()=>{const j=Gg(this.options,s),$=(()=>{const G={client:R(this,$r),queryKey:this.queryKey,meta:this.meta};return l(G),G})();return ee(this,Vr,!1),this.options.persister?this.options.persister(j,$,this):j($)},h=(()=>{const j={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:R(this,$r),state:this.state,fetchFn:u};return l(j),j})();(g=this.options.behavior)==null||g.onFetch(h,this),ee(this,As,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=h.fetchOptions)==null?void 0:v.meta))&&Ne(this,on,jn).call(this,{type:"fetch",meta:(x=h.fetchOptions)==null?void 0:x.meta}),ee(this,st,Jg({initialPromise:s==null?void 0:s.initialPromise,fn:h.fetchFn,onCancel:j=>{j instanceof gc&&j.revert&&this.setState({...R(this,As),fetchStatus:"idle"}),o.abort()},onFail:(j,W)=>{Ne(this,on,jn).call(this,{type:"failed",failureCount:j,error:W})},onPause:()=>{Ne(this,on,jn).call(this,{type:"pause"})},onContinue:()=>{Ne(this,on,jn).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const j=await R(this,st).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(A=(k=R(this,Ht).config).onSuccess)==null||A.call(k,j,this),(S=(M=R(this,Ht).config).onSettled)==null||S.call(M,j,this.state.error,this),j}catch(j){if(j instanceof gc){if(j.silent)return R(this,st).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Ne(this,on,jn).call(this,{type:"error",error:j}),(b=(w=R(this,Ht).config).onError)==null||b.call(w,j,this),(O=(D=R(this,Ht).config).onSettled)==null||O.call(D,this.state.data,j,this),j}finally{this.scheduleGc()}}},Br=new WeakMap,As=new WeakMap,Ht=new WeakMap,$r=new WeakMap,st=new WeakMap,Ko=new WeakMap,Vr=new WeakMap,on=new WeakSet,jn=function(t){const s=o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...ey(o.data,this.options),fetchMeta:t.meta??null};case"success":const l={...o,...Lp(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,As,t.manual?l:void 0),l;case"error":const u=t.error;return{...o,error:u,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}};this.state=s(this.state),ct.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),R(this,Ht).notify({query:this,type:"updated",action:t})})},$m);function ey(r,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yg(t.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function Lp(r,t){return{data:r,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ip(r){const t=typeof r.initialData=="function"?r.initialData():r.initialData,s=t!==void 0,o=s?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Tt,Pe,Go,Et,Wr,js,Dn,dr,Xo,Ds,Ls,qr,Hr,fr,Is,Le,Fo,yc,vc,xc,wc,Ec,bc,Sc,ty,Vm,U1=(Vm=class extends ei{constructor(t,s){super();pe(this,Le);pe(this,Tt);pe(this,Pe);pe(this,Go);pe(this,Et);pe(this,Wr);pe(this,js);pe(this,Dn);pe(this,dr);pe(this,Xo);pe(this,Ds);pe(this,Ls);pe(this,qr);pe(this,Hr);pe(this,fr);pe(this,Is,new Set);this.options=s,ee(this,Tt,t),ee(this,dr,null),ee(this,Dn,mc()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Pe).addObserver(this),Fp(R(this,Pe),this.options)?Ne(this,Le,Fo).call(this):this.updateResult(),Ne(this,Le,wc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _c(R(this,Pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _c(R(this,Pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ne(this,Le,Ec).call(this),Ne(this,Le,bc).call(this),R(this,Pe).removeObserver(this)}setOptions(t){const s=this.options,o=R(this,Pe);if(this.options=R(this,Tt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qt(this.options.enabled,R(this,Pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ne(this,Le,Sc).call(this),R(this,Pe).setOptions(this.options),s._defaulted&&!fc(this.options,s)&&R(this,Tt).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Pe),observer:this});const l=this.hasListeners();l&&Mp(R(this,Pe),o,this.options,s)&&Ne(this,Le,Fo).call(this),this.updateResult(),l&&(R(this,Pe)!==o||Qt(this.options.enabled,R(this,Pe))!==Qt(s.enabled,R(this,Pe))||yr(this.options.staleTime,R(this,Pe))!==yr(s.staleTime,R(this,Pe)))&&Ne(this,Le,yc).call(this);const u=Ne(this,Le,vc).call(this);l&&(R(this,Pe)!==o||Qt(this.options.enabled,R(this,Pe))!==Qt(s.enabled,R(this,Pe))||u!==R(this,fr))&&Ne(this,Le,xc).call(this,u)}getOptimisticResult(t){const s=R(this,Tt).getQueryCache().build(R(this,Tt),t),o=this.createResult(s,t);return B1(this,o)&&(ee(this,Et,o),ee(this,js,this.options),ee(this,Wr,R(this,Pe).state)),o}getCurrentResult(){return R(this,Et)}trackResult(t,s){return new Proxy(t,{get:(o,l)=>(this.trackProp(l),s==null||s(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&R(this,Dn).status==="pending"&&R(this,Dn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,l))})}trackProp(t){R(this,Is).add(t)}getCurrentQuery(){return R(this,Pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=R(this,Tt).defaultQueryOptions(t),o=R(this,Tt).getQueryCache().build(R(this,Tt),s);return o.fetch().then(()=>this.createResult(o,s))}fetch(t){return Ne(this,Le,Fo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,Et)))}createResult(t,s){var ie;const o=R(this,Pe),l=this.options,u=R(this,Et),d=R(this,Wr),h=R(this,js),g=t!==o?t.state:R(this,Go),{state:v}=t;let x={...v},k=!1,A;if(s._optimisticResults){const ue=this.hasListeners(),Ee=!ue&&Fp(t,s),Te=ue&&Mp(t,o,s,l);(Ee||Te)&&(x={...x,...ey(v.data,t.options)}),s._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:M,errorUpdatedAt:S,status:w}=x;A=x.data;let b=!1;if(s.placeholderData!==void 0&&A===void 0&&w==="pending"){let ue;u!=null&&u.isPlaceholderData&&s.placeholderData===(h==null?void 0:h.placeholderData)?(ue=u.data,b=!0):ue=typeof s.placeholderData=="function"?s.placeholderData((ie=R(this,Ls))==null?void 0:ie.state.data,R(this,Ls)):s.placeholderData,ue!==void 0&&(w="success",A=pc(u==null?void 0:u.data,ue,s),k=!0)}if(s.select&&A!==void 0&&!b)if(u&&A===(d==null?void 0:d.data)&&s.select===R(this,Xo))A=R(this,Ds);else try{ee(this,Xo,s.select),A=s.select(A),A=pc(u==null?void 0:u.data,A,s),ee(this,Ds,A),ee(this,dr,null)}catch(ue){ee(this,dr,ue)}R(this,dr)&&(M=R(this,dr),A=R(this,Ds),S=Date.now(),w="error");const D=x.fetchStatus==="fetching",O=w==="pending",j=w==="error",W=O&&D,$=A!==void 0,B={status:w,fetchStatus:x.fetchStatus,isPending:O,isSuccess:w==="success",isError:j,isInitialLoading:W,isLoading:W,data:A,dataUpdatedAt:x.dataUpdatedAt,error:M,errorUpdatedAt:S,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>g.dataUpdateCount||x.errorUpdateCount>g.errorUpdateCount,isFetching:D,isRefetching:D&&!O,isLoadingError:j&&!$,isPaused:x.fetchStatus==="paused",isPlaceholderData:k,isRefetchError:j&&$,isStale:ed(t,s),refetch:this.refetch,promise:R(this,Dn),isEnabled:Qt(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const ue=B.data!==void 0,Ee=B.status==="error"&&!ue,Te=Se=>{Ee?Se.reject(B.error):ue&&Se.resolve(B.data)},we=()=>{const Se=ee(this,Dn,B.promise=mc());Te(Se)},J=R(this,Dn);switch(J.status){case"pending":t.queryHash===o.queryHash&&Te(J);break;case"fulfilled":(Ee||B.data!==J.value)&&we();break;case"rejected":(!Ee||B.error!==J.reason)&&we();break}}return B}updateResult(){const t=R(this,Et),s=this.createResult(R(this,Pe),this.options);if(ee(this,Wr,R(this,Pe).state),ee(this,js,this.options),R(this,Wr).data!==void 0&&ee(this,Ls,R(this,Pe)),fc(s,t))return;ee(this,Et,s);const o=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!R(this,Is).size)return!0;const d=new Set(u??R(this,Is));return this.options.throwOnError&&d.add("error"),Object.keys(R(this,Et)).some(h=>{const m=h;return R(this,Et)[m]!==t[m]&&d.has(m)})};Ne(this,Le,ty).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ne(this,Le,wc).call(this)}},Tt=new WeakMap,Pe=new WeakMap,Go=new WeakMap,Et=new WeakMap,Wr=new WeakMap,js=new WeakMap,Dn=new WeakMap,dr=new WeakMap,Xo=new WeakMap,Ds=new WeakMap,Ls=new WeakMap,qr=new WeakMap,Hr=new WeakMap,fr=new WeakMap,Is=new WeakMap,Le=new WeakSet,Fo=function(t){Ne(this,Le,Sc).call(this);let s=R(this,Pe).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(Nt)),s},yc=function(){Ne(this,Le,Ec).call(this);const t=yr(this.options.staleTime,R(this,Pe));if(Jr||R(this,Et).isStale||!dc(t))return;const o=Qg(R(this,Et).dataUpdatedAt,t)+1;ee(this,qr,Fr.setTimeout(()=>{R(this,Et).isStale||this.updateResult()},o))},vc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Pe)):this.options.refetchInterval)??!1},xc=function(t){Ne(this,Le,bc).call(this),ee(this,fr,t),!(Jr||Qt(this.options.enabled,R(this,Pe))===!1||!dc(R(this,fr))||R(this,fr)===0)&&ee(this,Hr,Fr.setInterval(()=>{(this.options.refetchIntervalInBackground||Zc.isFocused())&&Ne(this,Le,Fo).call(this)},R(this,fr)))},wc=function(){Ne(this,Le,yc).call(this),Ne(this,Le,xc).call(this,Ne(this,Le,vc).call(this))},Ec=function(){R(this,qr)&&(Fr.clearTimeout(R(this,qr)),ee(this,qr,void 0))},bc=function(){R(this,Hr)&&(Fr.clearInterval(R(this,Hr)),ee(this,Hr,void 0))},Sc=function(){const t=R(this,Tt).getQueryCache().build(R(this,Tt),this.options);if(t===R(this,Pe))return;const s=R(this,Pe);ee(this,Pe,t),ee(this,Go,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},ty=function(t){ct.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(R(this,Et))}),R(this,Tt).getQueryCache().notify({query:R(this,Pe),type:"observerResultsUpdated"})})},Vm);function z1(r,t){return Qt(t.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&t.retryOnMount===!1)}function Fp(r,t){return z1(r,t)||r.state.data!==void 0&&_c(r,t,t.refetchOnMount)}function _c(r,t,s){if(Qt(t.enabled,r)!==!1&&yr(t.staleTime,r)!=="static"){const o=typeof s=="function"?s(r):s;return o==="always"||o!==!1&&ed(r,t)}return!1}function Mp(r,t,s,o){return(r!==t||Qt(o.enabled,r)===!1)&&(!s.suspense||r.state.status!=="error")&&ed(r,s)}function ed(r,t){return Qt(t.enabled,r)!==!1&&r.isStaleByTime(yr(t.staleTime,r))}function B1(r,t){return!fc(r.getCurrentResult(),t)}function Up(r){return{onFetch:(t,s)=>{var v,x,k,A,M;const o=t.options,l=(k=(x=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:x.fetchMore)==null?void 0:k.direction,u=((A=t.state.data)==null?void 0:A.pages)||[],d=((M=t.state.data)==null?void 0:M.pageParams)||[];let h={pages:[],pageParams:[]},m=0;const g=async()=>{let S=!1;const w=O=>{A1(O,()=>t.signal,()=>S=!0)},b=Gg(t.options,t.fetchOptions),D=async(O,j,W)=>{if(S)return Promise.reject();if(j==null&&O.pages.length)return Promise.resolve(O);const G=(()=>{const Ee={client:t.client,queryKey:t.queryKey,pageParam:j,direction:W?"backward":"forward",meta:t.options.meta};return w(Ee),Ee})(),B=await b(G),{maxPages:ie}=t.options,ue=W?O1:P1;return{pages:ue(O.pages,B,ie),pageParams:ue(O.pageParams,j,ie)}};if(l&&u.length){const O=l==="backward",j=O?$1:zp,W={pages:u,pageParams:d},$=j(o,W);h=await D(W,$,O)}else{const O=r??u.length;do{const j=m===0?d[0]??o.initialPageParam:zp(o,h);if(m>0&&j==null)break;h=await D(h,j),m++}while(m{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,g,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=g}}}function zp(r,{pages:t,pageParams:s}){const o=t.length-1;return t.length>0?r.getNextPageParam(t[o],t,s[o],s):void 0}function $1(r,{pages:t,pageParams:s}){var o;return t.length>0?(o=r.getPreviousPageParam)==null?void 0:o.call(r,t[0],t,s[0],s):void 0}var Yo,gn,yt,Qr,yn,ar,Wm,V1=(Wm=class extends Zg{constructor(t){super();pe(this,yn);pe(this,Yo);pe(this,gn);pe(this,yt);pe(this,Qr);ee(this,Yo,t.client),this.mutationId=t.mutationId,ee(this,yt,t.mutationCache),ee(this,gn,[]),this.state=t.state||W1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){R(this,gn).includes(t)||(R(this,gn).push(t),this.clearGcTimeout(),R(this,yt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,gn,R(this,gn).filter(s=>s!==t)),this.scheduleGc(),R(this,yt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){R(this,gn).length||(this.state.status==="pending"?this.scheduleGc():R(this,yt).remove(this))}continue(){var t;return((t=R(this,Qr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var d,h,m,g,v,x,k,A,M,S,w,b,D,O,j,W,$,G;const s=()=>{Ne(this,yn,ar).call(this,{type:"continue"})},o={client:R(this,Yo),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Qr,Jg({fn:()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),onFail:(B,ie)=>{Ne(this,yn,ar).call(this,{type:"failed",failureCount:B,error:ie})},onPause:()=>{Ne(this,yn,ar).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,yt).canRun(this)}));const l=this.state.status==="pending",u=!R(this,Qr).canStart();try{if(l)s();else{Ne(this,yn,ar).call(this,{type:"pending",variables:t,isPaused:u}),R(this,yt).config.onMutate&&await R(this,yt).config.onMutate(t,this,o);const ie=await((h=(d=this.options).onMutate)==null?void 0:h.call(d,t,o));ie!==this.state.context&&Ne(this,yn,ar).call(this,{type:"pending",context:ie,variables:t,isPaused:u})}const B=await R(this,Qr).start();return await((g=(m=R(this,yt).config).onSuccess)==null?void 0:g.call(m,B,t,this.state.context,this,o)),await((x=(v=this.options).onSuccess)==null?void 0:x.call(v,B,t,this.state.context,o)),await((A=(k=R(this,yt).config).onSettled)==null?void 0:A.call(k,B,null,this.state.variables,this.state.context,this,o)),await((S=(M=this.options).onSettled)==null?void 0:S.call(M,B,null,t,this.state.context,o)),Ne(this,yn,ar).call(this,{type:"success",data:B}),B}catch(B){try{await((b=(w=R(this,yt).config).onError)==null?void 0:b.call(w,B,t,this.state.context,this,o))}catch(ie){Promise.reject(ie)}try{await((O=(D=this.options).onError)==null?void 0:O.call(D,B,t,this.state.context,o))}catch(ie){Promise.reject(ie)}try{await((W=(j=R(this,yt).config).onSettled)==null?void 0:W.call(j,void 0,B,this.state.variables,this.state.context,this,o))}catch(ie){Promise.reject(ie)}try{await((G=($=this.options).onSettled)==null?void 0:G.call($,void 0,B,t,this.state.context,o))}catch(ie){Promise.reject(ie)}throw Ne(this,yn,ar).call(this,{type:"error",error:B}),B}finally{R(this,yt).runNext(this)}}},Yo=new WeakMap,gn=new WeakMap,yt=new WeakMap,Qr=new WeakMap,yn=new WeakSet,ar=function(t){const s=o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),ct.batch(()=>{R(this,gn).forEach(o=>{o.onMutationUpdate(t)}),R(this,yt).notify({mutation:this,type:"updated",action:t})})},Wm);function W1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ln,an,Jo,qm,q1=(qm=class extends ei{constructor(t={}){super();pe(this,Ln);pe(this,an);pe(this,Jo);this.config=t,ee(this,Ln,new Set),ee(this,an,new Map),ee(this,Jo,0)}build(t,s,o){const l=new V1({client:t,mutationCache:this,mutationId:++pa(this,Jo)._,options:t.defaultMutationOptions(s),state:o});return this.add(l),l}add(t){R(this,Ln).add(t);const s=wa(t);if(typeof s=="string"){const o=R(this,an).get(s);o?o.push(t):R(this,an).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(R(this,Ln).delete(t)){const s=wa(t);if(typeof s=="string"){const o=R(this,an).get(s);if(o)if(o.length>1){const l=o.indexOf(t);l!==-1&&o.splice(l,1)}else o[0]===t&&R(this,an).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=wa(t);if(typeof s=="string"){const o=R(this,an).get(s),l=o==null?void 0:o.find(u=>u.state.status==="pending");return!l||l===t}else return!0}runNext(t){var o;const s=wa(t);if(typeof s=="string"){const l=(o=R(this,an).get(s))==null?void 0:o.find(u=>u!==t&&u.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ct.batch(()=>{R(this,Ln).forEach(t=>{this.notify({type:"removed",mutation:t})}),R(this,Ln).clear(),R(this,an).clear()})}getAll(){return Array.from(R(this,Ln))}find(t){const s={exact:!0,...t};return this.getAll().find(o=>Ap(s,o))}findAll(t={}){return this.getAll().filter(s=>Ap(t,s))}notify(t){ct.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return ct.batch(()=>Promise.all(t.map(s=>s.continue().catch(Nt))))}},Ln=new WeakMap,an=new WeakMap,Jo=new WeakMap,qm);function wa(r){var t;return(t=r.options.scope)==null?void 0:t.id}var vn,Hm,H1=(Hm=class extends ei{constructor(t={}){super();pe(this,vn);this.config=t,ee(this,vn,new Map)}build(t,s,o){const l=s.queryKey,u=s.queryHash??Yc(l,s);let d=this.get(u);return d||(d=new M1({client:t,queryKey:l,queryHash:u,options:t.defaultQueryOptions(s),state:o,defaultOptions:t.getQueryDefaults(l)}),this.add(d)),d}add(t){R(this,vn).has(t.queryHash)||(R(this,vn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=R(this,vn).get(t.queryHash);s&&(t.destroy(),s===t&&R(this,vn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return R(this,vn).get(t)}getAll(){return[...R(this,vn).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(o=>Op(s,o))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(o=>Op(t,o)):s}notify(t){ct.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},vn=new WeakMap,Hm),qe,hr,pr,Fs,Ms,mr,Us,zs,Qm,Q1=(Qm=class{constructor(r={}){pe(this,qe);pe(this,hr);pe(this,pr);pe(this,Fs);pe(this,Ms);pe(this,mr);pe(this,Us);pe(this,zs);ee(this,qe,r.queryCache||new H1),ee(this,hr,r.mutationCache||new q1),ee(this,pr,r.defaultOptions||{}),ee(this,Fs,new Map),ee(this,Ms,new Map),ee(this,mr,0)}mount(){pa(this,mr)._++,R(this,mr)===1&&(ee(this,Us,Zc.subscribe(async r=>{r&&(await this.resumePausedMutations(),R(this,qe).onFocus())})),ee(this,zs,La.subscribe(async r=>{r&&(await this.resumePausedMutations(),R(this,qe).onOnline())})))}unmount(){var r,t;pa(this,mr)._--,R(this,mr)===0&&((r=R(this,Us))==null||r.call(this),ee(this,Us,void 0),(t=R(this,zs))==null||t.call(this),ee(this,zs,void 0))}isFetching(r){return R(this,qe).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return R(this,hr).findAll({...r,status:"pending"}).length}getQueryData(r){var s;const t=this.defaultQueryOptions({queryKey:r});return(s=R(this,qe).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(r){const t=this.defaultQueryOptions(r),s=R(this,qe).build(this,t),o=s.state.data;return o===void 0?this.fetchQuery(r):(r.revalidateIfStale&&s.isStaleByTime(yr(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(r){return R(this,qe).findAll(r).map(({queryKey:t,state:s})=>{const o=s.data;return[t,o]})}setQueryData(r,t,s){const o=this.defaultQueryOptions({queryKey:r}),l=R(this,qe).get(o.queryHash),u=l==null?void 0:l.state.data,d=R1(t,u);if(d!==void 0)return R(this,qe).build(this,o).setData(d,{...s,manual:!0})}setQueriesData(r,t,s){return ct.batch(()=>R(this,qe).findAll(r).map(({queryKey:o})=>[o,this.setQueryData(o,t,s)]))}getQueryState(r){var s;const t=this.defaultQueryOptions({queryKey:r});return(s=R(this,qe).get(t.queryHash))==null?void 0:s.state}removeQueries(r){const t=R(this,qe);ct.batch(()=>{t.findAll(r).forEach(s=>{t.remove(s)})})}resetQueries(r,t){const s=R(this,qe);return ct.batch(()=>(s.findAll(r).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...r},t)))}cancelQueries(r,t={}){const s={revert:!0,...t},o=ct.batch(()=>R(this,qe).findAll(r).map(l=>l.cancel(s)));return Promise.all(o).then(Nt).catch(Nt)}invalidateQueries(r,t={}){return ct.batch(()=>(R(this,qe).findAll(r).forEach(s=>{s.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},t)))}refetchQueries(r,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},o=ct.batch(()=>R(this,qe).findAll(r).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,s);return s.throwOnError||(u=u.catch(Nt)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Nt)}fetchQuery(r){const t=this.defaultQueryOptions(r);t.retry===void 0&&(t.retry=!1);const s=R(this,qe).build(this,t);return s.isStaleByTime(yr(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(Nt).catch(Nt)}fetchInfiniteQuery(r){return r.behavior=Up(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(Nt).catch(Nt)}ensureInfiniteQueryData(r){return r.behavior=Up(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return La.isOnline()?R(this,hr).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,qe)}getMutationCache(){return R(this,hr)}getDefaultOptions(){return R(this,pr)}setDefaultOptions(r){ee(this,pr,r)}setQueryDefaults(r,t){R(this,Fs).set(qo(r),{queryKey:r,defaultOptions:t})}getQueryDefaults(r){const t=[...R(this,Fs).values()],s={};return t.forEach(o=>{Ho(r,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(r,t){R(this,Ms).set(qo(r),{mutationKey:r,defaultOptions:t})}getMutationDefaults(r){const t=[...R(this,Ms).values()],s={};return t.forEach(o=>{Ho(r,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(r){if(r._defaulted)return r;const t={...R(this,pr).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return t.queryHash||(t.queryHash=Yc(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Jc&&(t.enabled=!1),t}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...R(this,pr).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){R(this,qe).clear(),R(this,hr).clear()}},qe=new WeakMap,hr=new WeakMap,pr=new WeakMap,Fs=new WeakMap,Ms=new WeakMap,mr=new WeakMap,Us=new WeakMap,zs=new WeakMap,Qm),ny=C.createContext(void 0),K1=r=>{const t=C.useContext(ny);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G1=({client:r,children:t})=>(C.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),p.jsx(ny.Provider,{value:r,children:t})),ry=C.createContext(!1),X1=()=>C.useContext(ry);ry.Provider;function Y1(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var J1=C.createContext(Y1()),Z1=()=>C.useContext(J1),eE=(r,t,s)=>{const o=s!=null&&s.state.error&&typeof r.throwOnError=="function"?Xg(r.throwOnError,[s.state.error,s]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||o)&&(t.isReset()||(r.retryOnMount=!1))},tE=r=>{C.useEffect(()=>{r.clearReset()},[r])},nE=({result:r,errorResetBoundary:t,throwOnError:s,query:o,suspense:l})=>r.isError&&!t.isReset()&&!r.isFetching&&o&&(l&&r.data===void 0||Xg(s,[r.error,o])),rE=r=>{if(r.suspense){const s=l=>l==="static"?l:Math.max(l??1e3,1e3),o=r.staleTime;r.staleTime=typeof o=="function"?(...l)=>s(o(...l)):s(o),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},sE=(r,t)=>r.isLoading&&r.isFetching&&!t,oE=(r,t)=>(r==null?void 0:r.suspense)&&t.isPending,Bp=(r,t,s)=>t.fetchOptimistic(r).catch(()=>{s.clearReset()});function iE(r,t,s){var k,A,M,S;const o=X1(),l=Z1(),u=K1(),d=u.defaultQueryOptions(r);(A=(k=u.getDefaultOptions().queries)==null?void 0:k._experimental_beforeQuery)==null||A.call(k,d);const h=u.getQueryCache().get(d.queryHash);d._optimisticResults=o?"isRestoring":"optimistic",rE(d),eE(d,l,h),tE(l);const m=!u.getQueryCache().get(d.queryHash),[g]=C.useState(()=>new t(u,d)),v=g.getOptimisticResult(d),x=!o&&r.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(w=>{const b=x?g.subscribe(ct.batchCalls(w)):Nt;return g.updateResult(),b},[g,x]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),C.useEffect(()=>{g.setOptions(d)},[d,g]),oE(d,v))throw Bp(d,g,l);if(nE({result:v,errorResetBoundary:l,throwOnError:d.throwOnError,query:h,suspense:d.suspense}))throw v.error;if((S=(M=u.getDefaultOptions().queries)==null?void 0:M._experimental_afterQuery)==null||S.call(M,d,v),d.experimental_prefetchInRender&&!Jr&&sE(v,o)){const w=m?Bp(d,g,l):h==null?void 0:h.promise;w==null||w.catch(Nt).finally(()=>{g.updateResult()})}return d.notifyOnChangeProps?v:g.trackResult(v)}function aE(r,t){return iE(r,U1)}const lE=new Q1({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});/** * @remix-run/router v1.23.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ia(){return Ia=Object.assign?Object.assign.bind():function(r){for(var t=1;t"u")throw new Error(t)}function sy(r,t){if(!r){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cE(){return Math.random().toString(36).substr(2,8)}function Vp(r,t){return{usr:r.state,key:r.key,idx:t}}function kc(r,t,s,o){return s===void 0&&(s=null),Ia({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof t=="string"?$a(t):t,{state:s,key:t&&t.key||o||cE()})}function oy(r){let{pathname:t="/",search:s="",hash:o=""}=r;return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function $a(r){let t={};if(r){let s=r.indexOf("#");s>=0&&(t.hash=r.substr(s),r=r.substr(0,s));let o=r.indexOf("?");o>=0&&(t.search=r.substr(o),r=r.substr(0,o)),r&&(t.pathname=r)}return t}function dE(r,t,s,o){o===void 0&&(o={});let{window:l=document.defaultView,v5Compat:u=!1}=o,d=l.history,h=gr.Pop,m=null,g=v();g==null&&(g=0,d.replaceState(Ia({},d.state,{idx:g}),""));function v(){return(d.state||{idx:null}).idx}function x(){h=gr.Pop;let w=v(),b=w==null?null:w-g;g=w,m&&m({action:h,location:S.location,delta:b})}function k(w,b){h=gr.Push;let D=kc(S.location,w,b);g=v()+1;let O=Vp(D,g),j=S.createHref(D);try{d.pushState(O,"",j)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;l.location.assign(j)}u&&m&&m({action:h,location:S.location,delta:1})}function A(w,b){h=gr.Replace;let D=kc(S.location,w,b);g=v();let O=Vp(D,g),j=S.createHref(D);d.replaceState(O,"",j),u&&m&&m({action:h,location:S.location,delta:0})}function M(w){let b=l.location.origin!=="null"?l.location.origin:l.location.href,D=typeof w=="string"?w:oy(w);return D=D.replace(/ $/,"%20"),Ot(b,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,b)}let S={get action(){return h},get location(){return r(l,d)},listen(w){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener($p,x),m=w,()=>{l.removeEventListener($p,x),m=null}},createHref(w){return t(l,w)},createURL:M,encodeLocation(w){let b=M(w);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:k,replace:A,go(w){return d.go(w)}};return S}var Wp;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Wp||(Wp={}));function fE(r,t,s){return s===void 0&&(s="/"),hE(r,t,s)}function hE(r,t,s,o){let l=typeof t=="string"?$a(t):t,u=ly(l.pathname||"/",s);if(u==null)return null;let d=iy(r);pE(d);let h=null,m=CE(u);for(let g=0;h==null&&g{let m={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};m.relativePath.startsWith("/")&&(Ot(m.relativePath.startsWith(o),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(o.length));let g=Ts([o,m.relativePath]),v=s.concat(m);u.children&&u.children.length>0&&(Ot(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),iy(u.children,t,v,g)),!(u.path==null&&!u.index)&&t.push({path:g,score:EE(g,u.index),routesMeta:v})};return r.forEach((u,d)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))l(u,d);else for(let m of ay(u.path))l(u,d,m)}),t}function ay(r){let t=r.split("/");if(t.length===0)return[];let[s,...o]=t,l=s.endsWith("?"),u=s.replace(/\?$/,"");if(o.length===0)return l?[u,""]:[u];let d=ay(o.join("/")),h=[];return h.push(...d.map(m=>m===""?u:[u,m].join("/"))),l&&h.push(...d),h.map(m=>r.startsWith("/")&&m===""?"/":m)}function pE(r){r.sort((t,s)=>t.score!==s.score?s.score-t.score:bE(t.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}const mE=/^:[\w-]+$/,gE=3,yE=2,vE=1,xE=10,wE=-2,qp=r=>r==="*";function EE(r,t){let s=r.split("/"),o=s.length;return s.some(qp)&&(o+=wE),t&&(o+=yE),s.filter(l=>!qp(l)).reduce((l,u)=>l+(mE.test(u)?gE:u===""?vE:xE),o)}function bE(r,t){return r.length===t.length&&r.slice(0,-1).every((o,l)=>o===t[l])?r[r.length-1]-t[t.length-1]:0}function SE(r,t,s){let{routesMeta:o}=r,l={},u="/",d=[];for(let h=0;h{let{paramName:k,isOptional:A}=v;if(k==="*"){let S=h[x]||"";d=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const M=h[x];return A&&!M?g[k]=void 0:g[k]=(M||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:r}}function kE(r,t,s){t===void 0&&(t=!1),s===void 0&&(s=!0),sy(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],l="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,m)=>(o.push({paramName:h,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),l+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":r!==""&&r!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),o]}function CE(r){try{return r.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return sy(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),r}}function ly(r,t){if(t==="/")return r;if(!r.toLowerCase().startsWith(t.toLowerCase()))return null;let s=t.endsWith("/")?t.length-1:t.length,o=r.charAt(s);return o&&o!=="/"?null:r.slice(s)||"/"}const RE=r=>r.replace(/\/\/+/g,"/"),Ts=r=>RE(r.join("/")),TE=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/");function NE(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const uy=["post","put","patch","delete"];new Set(uy);const PE=["get",...uy];new Set(PE);/** * React Router v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Fa(){return Fa=Object.assign?Object.assign.bind():function(r){for(var t=1;tObject.assign({},w,{params:Object.assign({},h,w.params),pathname:Ts([m,l.encodeLocation?l.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?m:Ts([m,l.encodeLocation?l.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),u,s,o);return t&&S?C.createElement(ti.Provider,{value:{location:Fa({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:gr.Pop}},S):S}function IE(){let r=WE(),t=NE(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),s=r instanceof Error?r.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),s?C.createElement("pre",{style:l},s):null,null)}const FE=C.createElement(IE,null);class ME extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){console.error("React Router caught the following error during render",t,s)}render(){return this.state.error!==void 0?C.createElement(Va.Provider,{value:this.props.routeContext},C.createElement(dy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UE(r){let{routeContext:t,match:s,children:o}=r,l=C.useContext(OE);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),C.createElement(Va.Provider,{value:t},o)}function zE(r,t,s,o){var l;if(t===void 0&&(t=[]),s===void 0&&(s=null),o===void 0&&(o=null),r==null){var u;if(!s)return null;if(s.errors)r=s.matches;else if((u=o)!=null&&u.v7_partialHydration&&t.length===0&&!s.initialized&&s.matches.length>0)r=s.matches;else return null}let d=r,h=(l=s)==null?void 0:l.errors;if(h!=null){let v=d.findIndex(x=>x.route.id&&(h==null?void 0:h[x.route.id])!==void 0);v>=0||Ot(!1),d=d.slice(0,Math.min(d.length,v+1))}let m=!1,g=-1;if(s&&o&&o.v7_partialHydration)for(let v=0;v=0?d=d.slice(0,g+1):d=[d[0]];break}}}return d.reduceRight((v,x,k)=>{let A,M=!1,S=null,w=null;s&&(A=h&&x.route.id?h[x.route.id]:void 0,S=x.route.errorElement||FE,m&&(g<0&&k===0?(qE("route-fallback"),M=!0,w=null):g===k&&(M=!0,w=x.route.hydrateFallbackElement||null)));let b=t.concat(d.slice(0,k+1)),D=()=>{let O;return A?O=S:M?O=w:x.route.Component?O=C.createElement(x.route.Component,null):x.route.element?O=x.route.element:O=v,C.createElement(UE,{match:x,routeContext:{outlet:v,matches:b,isDataRoute:s!=null},children:O})};return s&&(x.route.ErrorBoundary||x.route.errorElement||k===0)?C.createElement(ME,{location:s.location,revalidation:s.revalidation,component:S,error:A,children:D(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):D()},null)}var fy=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(fy||{});function BE(r){let t=C.useContext(AE);return t||Ot(!1),t}function $E(r){let t=C.useContext(Va);return t||Ot(!1),t}function VE(r){let t=$E(),s=t.matches[t.matches.length-1];return s.route.id||Ot(!1),s.route.id}function WE(){var r;let t=C.useContext(dy),s=BE(fy.UseRouteError),o=VE();return t!==void 0?t:(r=s.errors)==null?void 0:r[o]}const Hp={};function qE(r,t,s){Hp[r]||(Hp[r]=!0)}function HE(r,t){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Cc(r){Ot(!1)}function QE(r){let{basename:t="/",children:s=null,location:o,navigationType:l=gr.Pop,navigator:u,static:d=!1,future:h}=r;td()&&Ot(!1);let m=t.replace(/^\/*/,"/"),g=C.useMemo(()=>({basename:m,navigator:u,static:d,future:Fa({v7_relativeSplatPath:!1},h)}),[m,h,u,d]);typeof o=="string"&&(o=$a(o));let{pathname:v="/",search:x="",hash:k="",state:A=null,key:M="default"}=o,S=C.useMemo(()=>{let w=ly(v,m);return w==null?null:{location:{pathname:w,search:x,hash:k,state:A,key:M},navigationType:l}},[m,v,x,k,A,M,l]);return S==null?null:C.createElement(cy.Provider,{value:g},C.createElement(ti.Provider,{children:s,value:S}))}function KE(r){let{children:t,location:s}=r;return DE(Rc(t),s)}new Promise(()=>{});function Rc(r,t){t===void 0&&(t=[]);let s=[];return C.Children.forEach(r,(o,l)=>{if(!C.isValidElement(o))return;let u=[...t,l];if(o.type===C.Fragment){s.push.apply(s,Rc(o.props.children,u));return}o.type!==Cc&&Ot(!1),!o.props.index||!o.props.children||Ot(!1);let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Rc(o.props.children,u)),s.push(d)}),s}/** * React Router DOM v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */const GE="6";try{window.__reactRouterVersion=GE}catch{}const XE="startTransition",Qp=Gm[XE];function YE(r){let{basename:t,children:s,future:o,window:l}=r,u=C.useRef();u.current==null&&(u.current=uE({window:l,v5Compat:!0}));let d=u.current,[h,m]=C.useState({action:d.action,location:d.location}),{v7_startTransition:g}=o||{},v=C.useCallback(x=>{g&&Qp?Qp(()=>m(x)):m(x)},[m,g]);return C.useLayoutEffect(()=>d.listen(v),[d,v]),C.useEffect(()=>HE(o),[o]),C.createElement(QE,{basename:t,children:s,location:h.location,navigationType:h.action,navigator:d,future:o})}var Kp;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Kp||(Kp={}));var Gp;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Gp||(Gp={}));function hy(r,t){return function(){return r.apply(t,arguments)}}const{toString:JE}=Object.prototype,{getPrototypeOf:Bs}=Object,{iterator:ni,toStringTag:py}=Symbol,Ma=(({hasOwnProperty:r})=>(t,s)=>r.call(t,s))(Object.prototype),Qo=(r,t)=>{let s=r;const o=[];for(;s!=null&&s!==Object.prototype;){if(o.indexOf(s)!==-1)return!1;if(o.push(s),Ma(s,t))return!0;s=Bs(s)}return!1},ZE=(r,t)=>r!=null&&Qo(r,t)?r[t]:void 0,rd=(r=>t=>{const s=JE.call(t);return r[s]||(r[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),cn=r=>(r=r.toLowerCase(),t=>rd(t)===r),Wa=r=>t=>typeof t===r,{isArray:Zr}=Array,$s=Wa("undefined");function Ws(r){return r!==null&&!$s(r)&&r.constructor!==null&&!$s(r.constructor)&&Pt(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const my=cn("ArrayBuffer");function eb(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&my(r.buffer),t}const tb=Wa("string"),Pt=Wa("function"),gy=Wa("number"),qs=r=>r!==null&&typeof r=="object",nb=r=>r===!0||r===!1,Ra=r=>{if(!qs(r))return!1;const t=Bs(r);return(t===null||t===Object.prototype||Bs(t)===null)&&!Qo(r,py)&&!Qo(r,ni)},rb=r=>{if(!qs(r)||Ws(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},sb=cn("Date"),ob=cn("File"),ib=r=>!!(r&&typeof r.uri<"u"),ab=r=>r&&typeof r.getParts<"u",lb=cn("Blob"),ub=cn("FileList"),cb=r=>qs(r)&&Pt(r.pipe);function db(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Xp=db(),Yp=typeof Xp.FormData<"u"?Xp.FormData:void 0,fb=r=>{if(!r)return!1;if(Yp&&r instanceof Yp)return!0;const t=Bs(r);if(!t||t===Object.prototype||!Pt(r.append))return!1;const s=rd(r);return s==="formdata"||s==="object"&&Pt(r.toString)&&r.toString()==="[object FormData]"},hb=cn("URLSearchParams"),[pb,mb,gb,yb]=["ReadableStream","Request","Response","Headers"].map(cn),vb=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ri(r,t,{allOwnKeys:s=!1}={}){if(r===null||typeof r>"u")return;let o,l;if(typeof r!="object"&&(r=[r]),Zr(r))for(o=0,l=r.length;o0;)if(l=s[o],t===l.toLowerCase())return l;return null}const Mr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vy=r=>!$s(r)&&r!==Mr;function Tc(...r){const{caseless:t,skipUndefined:s}=vy(this)&&this||{},o={},l=(u,d)=>{if(d==="__proto__"||d==="constructor"||d==="prototype")return;const h=t&&typeof d=="string"&&yy(o,d)||d,m=Ma(o,h)?o[h]:void 0;Ra(m)&&Ra(u)?o[h]=Tc(m,u):Ra(u)?o[h]=Tc({},u):Zr(u)?o[h]=u.slice():(!s||!$s(u))&&(o[h]=u)};for(let u=0,d=r.length;u(ri(t,(l,u)=>{s&&Pt(l)?Object.defineProperty(r,u,{__proto__:null,value:hy(l,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,u,{__proto__:null,value:l,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),r),wb=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Eb=(r,t,s,o)=>{r.prototype=Object.create(t.prototype,o),Object.defineProperty(r.prototype,"constructor",{__proto__:null,value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{__proto__:null,value:t.prototype}),s&&Object.assign(r.prototype,s)},bb=(r,t,s,o)=>{let l,u,d;const h={};if(t=t||{},r==null)return t;do{for(l=Object.getOwnPropertyNames(r),u=l.length;u-- >0;)d=l[u],(!o||o(d,r,t))&&!h[d]&&(t[d]=r[d],h[d]=!0);r=s!==!1&&Bs(r)}while(r&&(!s||s(r,t))&&r!==Object.prototype);return t},Sb=(r,t,s)=>{r=String(r),(s===void 0||s>r.length)&&(s=r.length),s-=t.length;const o=r.indexOf(t,s);return o!==-1&&o===s},_b=r=>{if(!r)return null;if(Zr(r))return r;let t=r.length;if(!gy(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=r[t];return s},kb=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&Bs(Uint8Array)),Cb=(r,t)=>{const o=(r&&r[ni]).call(r);let l;for(;(l=o.next())&&!l.done;){const u=l.value;t.call(r,u[0],u[1])}},Rb=(r,t)=>{let s;const o=[];for(;(s=r.exec(t))!==null;)o.push(s);return o},Tb=cn("HTMLFormElement"),Nb=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,o,l){return o.toUpperCase()+l}),{propertyIsEnumerable:Pb}=Object.prototype,Ob=cn("RegExp"),xy=(r,t)=>{const s=Object.getOwnPropertyDescriptors(r),o={};ri(s,(l,u)=>{let d;(d=t(l,u,r))!==!1&&(o[u]=d||l)}),Object.defineProperties(r,o)},Ab=r=>{xy(r,(t,s)=>{if(Pt(r)&&["arguments","caller","callee"].includes(s))return!1;const o=r[s];if(Pt(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},jb=(r,t)=>{const s={},o=l=>{l.forEach(u=>{s[u]=!0})};return Zr(r)?o(r):o(String(r).split(t)),s},Db=()=>{},Lb=(r,t)=>r!=null&&Number.isFinite(r=+r)?r:t;function Ib(r){return!!(r&&Pt(r.append)&&r[py]==="FormData"&&r[ni])}const Fb=r=>{const t=new WeakSet,s=o=>{if(qs(o)){if(t.has(o))return;if(Ws(o))return o;if(!("toJSON"in o)){t.add(o);const l=Zr(o)?[]:{};return ri(o,(u,d)=>{const h=s(u);!$s(h)&&(l[d]=h)}),t.delete(o),l}}return o};return s(r)},Mb=cn("AsyncFunction"),Ub=r=>r&&(qs(r)||Pt(r))&&Pt(r.then)&&Pt(r.catch),wy=((r,t)=>r?setImmediate:t?((s,o)=>(Mr.addEventListener("message",({source:l,data:u})=>{l===Mr&&u===s&&o.length&&o.shift()()},!1),l=>{o.push(l),Mr.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",Pt(Mr.postMessage)),zb=typeof queueMicrotask<"u"?queueMicrotask.bind(Mr):typeof process<"u"&&process.nextTick||wy,Ey=r=>r!=null&&Pt(r[ni]),Bb=r=>r!=null&&Qo(r,ni)&&Ey(r),P={isArray:Zr,isArrayBuffer:my,isBuffer:Ws,isFormData:fb,isArrayBufferView:eb,isString:tb,isNumber:gy,isBoolean:nb,isObject:qs,isPlainObject:Ra,isEmptyObject:rb,isReadableStream:pb,isRequest:mb,isResponse:gb,isHeaders:yb,isUndefined:$s,isDate:sb,isFile:ob,isReactNativeBlob:ib,isReactNative:ab,isBlob:lb,isRegExp:Ob,isFunction:Pt,isStream:cb,isURLSearchParams:hb,isTypedArray:kb,isFileList:ub,forEach:ri,merge:Tc,extend:xb,trim:vb,stripBOM:wb,inherits:Eb,toFlatObject:bb,kindOf:rd,kindOfTest:cn,endsWith:Sb,toArray:_b,forEachEntry:Cb,matchAll:Rb,isHTMLForm:Tb,hasOwnProperty:Ma,hasOwnProp:Ma,hasOwnInPrototypeChain:Qo,getSafeProp:ZE,reduceDescriptors:xy,freezeMethods:Ab,toObjectSet:jb,toCamelCase:Nb,noop:Db,toFiniteNumber:Lb,findKey:yy,global:Mr,isContextDefined:vy,isSpecCompliantForm:Ib,toJSONObject:Fb,isAsyncFn:Mb,isThenable:Ub,setImmediate:wy,asap:zb,isIterable:Ey,isSafeIterable:Bb},$b=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vb=r=>{const t={};let s,o,l;return r&&r.split(` `).forEach(function(d){l=d.indexOf(":"),s=d.substring(0,l).trim().toLowerCase(),o=d.substring(l+1).trim(),!(!s||t[s]&&$b[s])&&(s==="set-cookie"?t[s]?t[s].push(o):t[s]=[o]:t[s]=t[s]?t[s]+", "+o:o)}),t};function Wb(r){let t=0,s=r.length;for(;tt;){const o=r.charCodeAt(s-1);if(o!==9&&o!==32)break;s-=1}return t===0&&s===r.length?r:r.slice(t,s)}const qb=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Hb=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function sd(r,t){return P.isArray(r)?r.map(s=>sd(s,t)):Wb(String(r).replace(t,""))}const Qb=r=>sd(r,qb),Kb=r=>sd(r,Hb);function by(r){const t=Object.create(null);return P.forEach(r.toJSON(),(s,o)=>{t[o]=Kb(s)}),t}const Jp=Symbol("internals");function Do(r){return r&&String(r).trim().toLowerCase()}function Ta(r){return r===!1||r==null?r:P.isArray(r)?r.map(Ta):Qb(String(r))}function Gb(r){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=s.exec(r);)t[o[1]]=o[2];return t}const Xb=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Ku(r,t,s,o,l){if(P.isFunction(o))return o.call(this,t,s);if(l&&(t=s),!!P.isString(t)){if(P.isString(o))return t.indexOf(o)!==-1;if(P.isRegExp(o))return o.test(t)}}function Yb(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,s,o)=>s.toUpperCase()+o)}function Jb(r,t){const s=P.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(r,o+s,{__proto__:null,value:function(l,u,d){return this[o].call(this,t,l,u,d)},configurable:!0})})}let vt=class{constructor(t){t&&this.set(t)}set(t,s,o){const l=this;function u(h,m,g){const v=Do(m);if(!v)return;const x=P.findKey(l,v);(!x||l[x]===void 0||g===!0||g===void 0&&l[x]!==!1)&&(l[x||m]=Ta(h))}const d=(h,m)=>P.forEach(h,(g,v)=>u(g,v,m));if(P.isPlainObject(t)||t instanceof this.constructor)d(t,s);else if(P.isString(t)&&(t=t.trim())&&!Xb(t))d(Vb(t),s);else if(P.isObject(t)&&P.isSafeIterable(t)){let h=Object.create(null),m,g;for(const v of t){if(!P.isArray(v))throw new TypeError("Object iterator must return a key-value pair");g=v[0],P.hasOwnProp(h,g)?(m=h[g],h[g]=P.isArray(m)?[...m,v[1]]:[m,v[1]]):h[g]=v[1]}d(h,s)}else t!=null&&u(s,t,o);return this}get(t,s){if(t=Do(t),t){const o=P.findKey(this,t);if(o){const l=this[o];if(!s)return l;if(s===!0)return Gb(l);if(P.isFunction(s))return s.call(this,l,o);if(P.isRegExp(s))return s.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,s){if(t=Do(t),t){const o=P.findKey(this,t);return!!(o&&this[o]!==void 0&&(!s||Ku(this,this[o],o,s)))}return!1}delete(t,s){const o=this;let l=!1;function u(d){if(d=Do(d),d){const h=P.findKey(o,d);h&&(!s||Ku(o,o[h],h,s))&&(delete o[h],l=!0)}}return P.isArray(t)?t.forEach(u):u(t),l}clear(t){const s=Object.keys(this);let o=s.length,l=!1;for(;o--;){const u=s[o];(!t||Ku(this,this[u],u,t,!0))&&(delete this[u],l=!0)}return l}normalize(t){const s=this,o={};return P.forEach(this,(l,u)=>{const d=P.findKey(o,u);if(d){s[d]=Ta(l),delete s[u];return}const h=t?Yb(u):String(u).trim();h!==u&&delete s[u],s[h]=Ta(l),o[h]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const s=Object.create(null);return P.forEach(this,(o,l)=>{o!=null&&o!==!1&&(s[l]=t&&P.isArray(o)?o.join(", "):o)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,s])=>t+": "+s).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){const o=new this(t);return s.forEach(l=>o.set(l)),o}static accessor(t){const o=(this[Jp]=this[Jp]={accessors:{}}).accessors,l=this.prototype;function u(d){const h=Do(d);o[h]||(Jb(l,d),o[h]=!0)}return P.isArray(t)?t.forEach(u):u(t),this}};vt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);P.reduceDescriptors(vt.prototype,({value:r},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(o){this[s]=o}}});P.freezeMethods(vt);const Zb="[REDACTED ****]";function eS(r){if(P.hasOwnProp(r,"toJSON"))return!0;let t=Object.getPrototypeOf(r);for(;t&&t!==Object.prototype;){if(P.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function tS(r,t){const s=new Set(t.map(u=>String(u).toLowerCase())),o=[],l=u=>{if(u===null||typeof u!="object"||P.isBuffer(u))return u;if(o.indexOf(u)!==-1)return;u instanceof vt&&(u=u.toJSON()),o.push(u);let d;if(P.isArray(u))d=[],u.forEach((h,m)=>{const g=l(h);P.isUndefined(g)||(d[m]=g)});else{if(!P.isPlainObject(u)&&eS(u))return o.pop(),u;d=Object.create(null);for(const[h,m]of Object.entries(u)){const g=s.has(h.toLowerCase())?Zb:l(m);P.isUndefined(g)||(d[h]=g)}}return o.pop(),d};return l(r)}let Y=class Sy extends Error{static from(t,s,o,l,u,d){const h=new Sy(t.message,s||t.code,o,l,u);return Object.defineProperty(h,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),h.name=t.name,t.status!=null&&h.status==null&&(h.status=t.status),d&&Object.assign(h,d),h}constructor(t,s,o,l,u){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),o&&(this.config=o),l&&(this.request=l),u&&(this.response=u,this.status=u.status)}toJSON(){const t=this.config,s=t&&P.hasOwnProp(t,"redact")?t.redact:void 0,o=P.isArray(s)&&s.length>0?tS(t,s):P.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:o,code:this.code,status:this.status}}};Y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Y.ERR_BAD_OPTION="ERR_BAD_OPTION";Y.ECONNABORTED="ECONNABORTED";Y.ETIMEDOUT="ETIMEDOUT";Y.ECONNREFUSED="ECONNREFUSED";Y.ERR_NETWORK="ERR_NETWORK";Y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Y.ERR_DEPRECATED="ERR_DEPRECATED";Y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Y.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Y.ERR_CANCELED="ERR_CANCELED";Y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Y.ERR_INVALID_URL="ERR_INVALID_URL";Y.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const nS=null,_y=100;function Nc(r){return P.isPlainObject(r)||P.isArray(r)}function ky(r){return P.endsWith(r,"[]")?r.slice(0,-2):r}function Gu(r,t,s){return r?r.concat(t).map(function(l,u){return l=ky(l),!s&&u?"["+l+"]":l}).join(s?".":""):t}function rS(r){return P.isArray(r)&&!r.some(Nc)}const sS=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function qa(r,t,s){if(!P.isObject(r))throw new TypeError("target must be an object");t=t||new FormData,s=P.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(D,O){return!P.isUndefined(O[D])});const o=s.metaTokens,l=s.visitor||M,u=s.dots,d=s.indexes,h=s.Blob||typeof Blob<"u"&&Blob,m=s.maxDepth===void 0?_y:s.maxDepth,g=h&&P.isSpecCompliantForm(t),v=[];if(!P.isFunction(l))throw new TypeError("visitor must be a function");function x(b){if(b===null)return"";if(P.isDate(b))return b.toISOString();if(P.isBoolean(b))return b.toString();if(!g&&P.isBlob(b))throw new Y("Blob is not supported. Use a Buffer instead.");if(P.isArrayBuffer(b)||P.isTypedArray(b)){if(g&&typeof h=="function")return new h([b]);if(typeof Buffer<"u")return Buffer.from(b);throw new Y("Blob is not supported. Use a Buffer instead.",Y.ERR_NOT_SUPPORT)}return b}function k(b){if(b>m)throw new Y("Object is too deeply nested ("+b+" levels). Max depth: "+m,Y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function A(b,D){if(m===1/0)return JSON.stringify(b);const O=[];return JSON.stringify(b,function(W,$){if(!P.isObject($))return $;for(;O.length&&O[O.length-1]!==this;)O.pop();return O.push($),k(D+O.length-1),$})}function M(b,D,O){let j=b;if(P.isReactNative(t)&&P.isReactNativeBlob(b))return t.append(Gu(O,D,u),x(b)),!1;if(b&&!O&&typeof b=="object"){if(P.endsWith(D,"{}"))D=o?D:D.slice(0,-2),b=A(b,1);else if(P.isArray(b)&&rS(b)||(P.isFileList(b)||P.endsWith(D,"[]"))&&(j=P.toArray(b)))return D=ky(D),j.forEach(function($,G){!(P.isUndefined($)||$===null)&&t.append(d===!0?Gu([D],G,u):d===null?D:D+"[]",x($))}),!1}return Nc(b)?!0:(t.append(Gu(O,D,u),x(b)),!1)}const S=Object.assign(sS,{defaultVisitor:M,convertValue:x,isVisitable:Nc});function w(b,D,O=0){if(!P.isUndefined(b)){if(k(O),v.indexOf(b)!==-1)throw new Error("Circular reference detected in "+D.join("."));v.push(b),P.forEach(b,function(W,$){(!(P.isUndefined(W)||W===null)&&l.call(t,W,P.isString($)?$.trim():$,D,S))===!0&&w(W,D?D.concat($):[$],O+1)}),v.pop()}}if(!P.isObject(r))throw new TypeError("data must be an object");return w(r),t}function Zp(r){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(r).replace(/[!'()~]|%20/g,function(o){return t[o]})}function od(r,t){this._pairs=[],r&&qa(r,this,t)}const Cy=od.prototype;Cy.append=function(t,s){this._pairs.push([t,s])};Cy.toString=function(t){const s=t?o=>t.call(this,o,Zp):Zp;return this._pairs.map(function(l){return s(l[0])+"="+s(l[1])},"").join("&")};function oS(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ry(r,t,s){if(!t)return r;r=r||"";const o=P.isFunction(s)?{serialize:s}:s,l=P.getSafeProp(o,"encode")||oS,u=P.getSafeProp(o,"serialize");let d;if(u?d=u(t,o):d=P.isURLSearchParams(t)?t.toString():new od(t,o).toString(l),d){const h=r.indexOf("#");h!==-1&&(r=r.slice(0,h)),r+=(r.indexOf("?")===-1?"?":"&")+d}return r}class em{constructor(){this.handlers=[]}use(t,s,o){return this.handlers.push({fulfilled:t,rejected:s,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,function(o){o!==null&&t(o)})}}const id={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},iS=typeof URLSearchParams<"u"?URLSearchParams:od,aS=typeof FormData<"u"?FormData:null,lS=typeof Blob<"u"?Blob:null,uS={isBrowser:!0,classes:{URLSearchParams:iS,FormData:aS,Blob:lS},protocols:["http","https","file","blob","url","data"]},ad=typeof window<"u"&&typeof document<"u",Pc=typeof navigator=="object"&&navigator||void 0,cS=ad&&(!Pc||["ReactNative","NativeScript","NS"].indexOf(Pc.product)<0),dS=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fS=ad&&window.location.href||"http://localhost",hS=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ad,hasStandardBrowserEnv:cS,hasStandardBrowserWebWorkerEnv:dS,navigator:Pc,origin:fS},Symbol.toStringTag,{value:"Module"})),dt={...hS,...uS};function pS(r,t){return qa(r,new dt.classes.URLSearchParams,{visitor:function(s,o,l,u){return dt.isNode&&P.isBuffer(s)?(this.append(o,s.toString("base64")),!1):u.defaultVisitor.apply(this,arguments)},...t})}const tm=_y;function Ty(r){if(r>tm)throw new Y("FormData field is too deeply nested ("+r+" levels). Max depth: "+tm,Y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function mS(r){const t=[],s=/\w+|\[(\w*)]/g;let o;for(;(o=s.exec(r))!==null;)Ty(t.length),t.push(o[0]==="[]"?"":o[1]||o[0]);return t}function gS(r){const t={},s=Object.keys(r);let o;const l=s.length;let u;for(o=0;o=s.length;return d=!d&&P.isArray(l)?l.length:d,m?(P.hasOwnProp(l,d)?l[d]=P.isArray(l[d])?l[d].concat(o):[l[d],o]:l[d]=o,!h):((!P.hasOwnProp(l,d)||!P.isObject(l[d]))&&(l[d]=[]),t(s,o,l[d],u)&&P.isArray(l[d])&&(l[d]=gS(l[d])),!h)}if(P.isFormData(r)&&P.isFunction(r.entries)){const s={};return P.forEachEntry(r,(o,l)=>{t(mS(o),l,s,0)}),s}return null}const Cs=(r,t)=>r!=null&&P.hasOwnProp(r,t)?r[t]:void 0;function yS(r,t,s){if(P.isString(r))try{return(t||JSON.parse)(r),P.trim(r)}catch(o){if(o.name!=="SyntaxError")throw o}return(s||JSON.stringify)(r)}const si={transitional:id,adapter:["xhr","http","fetch"],transformRequest:[function(t,s){const o=s.getContentType()||"",l=o.indexOf("application/json")>-1,u=P.isObject(t);if(u&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return l?JSON.stringify(Ny(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t)||P.isReadableStream(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;if(u){const m=Cs(this,"formSerializer");if(o.indexOf("application/x-www-form-urlencoded")>-1)return pS(t,m).toString();if((h=P.isFileList(t))||o.indexOf("multipart/form-data")>-1){const g=Cs(this,"env"),v=g&&g.FormData;return qa(h?{"files[]":t}:t,v&&new v,m)}}return u||l?(s.setContentType("application/json",!1),yS(t)):t}],transformResponse:[function(t){const s=Cs(this,"transitional")||si.transitional,o=s&&s.forcedJSONParsing,l=Cs(this,"responseType"),u=l==="json";if(P.isResponse(t)||P.isReadableStream(t))return t;if(t&&P.isString(t)&&(o&&!l||u)){const h=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(t,Cs(this,"parseReviver"))}catch(m){if(h)throw m.name==="SyntaxError"?Y.from(m,Y.ERR_BAD_RESPONSE,this,null,Cs(this,"response")):m}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dt.classes.FormData,Blob:dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch","query"],r=>{si.headers[r]={}});function Xu(r,t){const s=this||si,o=t||s,l=vt.from(o.headers);let u=o.data;return P.forEach(r,function(h){u=h.call(s,u,l.normalize(),t?t.status:void 0)}),l.normalize(),u}function Py(r){return!!(r&&r.__CANCEL__)}let oi=class extends Y{constructor(t,s,o){super(t??"canceled",Y.ERR_CANCELED,s,o),this.name="CanceledError",this.__CANCEL__=!0}};function Oy(r,t,s){const o=s.config.validateStatus;!s.status||!o||o(s.status)?r(s):t(new Y("Request failed with status code "+s.status,s.status>=400&&s.status<500?Y.ERR_BAD_REQUEST:Y.ERR_BAD_RESPONSE,s.config,s.request,s))}function vS(r){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(r);return t&&t[1]||""}function xS(r,t){r=r||10;const s=new Array(r),o=new Array(r);let l=0,u=0,d;return t=t!==void 0?t:1e3,function(m){const g=Date.now(),v=o[u];d||(d=g),s[l]=m,o[l]=g;let x=u,k=0;for(;x!==l;)k+=s[x++],x=x%r;if(l=(l+1)%r,l===u&&(u=(u+1)%r),g-d{s=v,l=null,u&&(clearTimeout(u),u=null),r(...g)};return[(...g)=>{const v=Date.now(),x=v-s;x>=o?d(g,v):(l=g,u||(u=setTimeout(()=>{u=null,d(l)},o-x)))},()=>l&&d(l)]}const Ua=(r,t,s=3)=>{let o=0;const l=xS(50,250);return wS(u=>{if(!u||typeof u.loaded!="number")return;const d=u.loaded,h=u.lengthComputable?u.total:void 0,m=h!=null?Math.min(d,h):d,g=Math.max(0,m-o),v=l(g);o=Math.max(o,m);const x={loaded:m,total:h,progress:h?m/h:void 0,bytes:g,rate:v||void 0,estimated:v&&h?(h-m)/v:void 0,event:u,lengthComputable:h!=null,[t?"download":"upload"]:!0};r(x)},s)},nm=(r,t)=>{const s=r!=null;return[o=>t[0]({lengthComputable:s,total:r,loaded:o}),t[1]]},rm=r=>(...t)=>P.asap(()=>r(...t)),ES=dt.hasStandardBrowserEnv?((r,t)=>s=>(s=new URL(s,dt.origin),r.protocol===s.protocol&&r.host===s.host&&(t||r.port===s.port)))(new URL(dt.origin),dt.navigator&&/(msie|trident)/i.test(dt.navigator.userAgent)):()=>!0,bS=dt.hasStandardBrowserEnv?{write(r,t,s,o,l,u,d){if(typeof document>"u")return;const h=[`${r}=${encodeURIComponent(t)}`];P.isNumber(s)&&h.push(`expires=${new Date(s).toUTCString()}`),P.isString(o)&&h.push(`path=${o}`),P.isString(l)&&h.push(`domain=${l}`),u===!0&&h.push("secure"),P.isString(d)&&h.push(`SameSite=${d}`),document.cookie=h.join("; ")},read(r){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let s=0;sr instanceof vt?{...r}:r;function es(r,t){r=r||{},t=t||{};const s=Object.create(null);Object.defineProperty(s,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function o(v,x,k,A){return P.isPlainObject(v)&&P.isPlainObject(x)?P.merge.call({caseless:A},v,x):P.isPlainObject(x)?P.merge({},x):P.isArray(x)?x.slice():x}function l(v,x,k,A){if(P.isUndefined(x)){if(!P.isUndefined(v))return o(void 0,v,k,A)}else return o(v,x,k,A)}function u(v,x){if(!P.isUndefined(x))return o(void 0,x)}function d(v,x){if(P.isUndefined(x)){if(!P.isUndefined(v))return o(void 0,v)}else return o(void 0,x)}function h(v){const x=P.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!P.isUndefined(x))if(P.isPlainObject(x)){if(P.hasOwnProp(x,v))return x[v]}else return;const k=P.hasOwnProp(r,"transitional")?r.transitional:void 0;if(P.isPlainObject(k)&&P.hasOwnProp(k,v))return k[v]}function m(v,x,k){if(P.hasOwnProp(t,k))return o(v,x);if(P.hasOwnProp(r,k))return o(void 0,v)}const g={url:u,method:u,data:u,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,allowedSocketPaths:d,responseEncoding:d,validateStatus:m,headers:(v,x,k)=>l(om(v),om(x),k,!0)};return P.forEach(Object.keys({...r,...t}),function(x){if(x==="__proto__"||x==="constructor"||x==="prototype")return;const k=P.hasOwnProp(g,x)?g[x]:l,A=P.hasOwnProp(r,x)?r[x]:void 0,M=P.hasOwnProp(t,x)?t[x]:void 0,S=k(A,M,x);P.isUndefined(S)&&k!==m||(s[x]=S)}),P.hasOwnProp(t,"validateStatus")&&P.isUndefined(t.validateStatus)&&h("validateStatusUndefinedResolves")===!1&&(P.hasOwnProp(r,"validateStatus")?s.validateStatus=o(void 0,r.validateStatus):delete s.validateStatus),s}const NS=["content-type","content-length"];function PS(r,t,s){if(s!=="content-only"){r.set(t);return}Object.entries(t||{}).forEach(([o,l])=>{NS.includes(o.toLowerCase())&&r.set(o,l)})}const OS=r=>encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(t,s)=>String.fromCharCode(parseInt(s,16)));function jy(r){const t=es({},r),s=k=>P.hasOwnProp(t,k)?t[k]:void 0,o=s("data");let l=s("withXSRFToken");const u=s("xsrfHeaderName"),d=s("xsrfCookieName");let h=s("headers");const m=s("auth"),g=s("baseURL"),v=s("allowAbsoluteUrls"),x=s("url");if(t.headers=h=vt.from(h),t.url=Ry(Ay(g,x,v,t),s("params"),s("paramsSerializer")),m){const k=P.getSafeProp(m,"username")||"",A=P.getSafeProp(m,"password")||"";try{h.set("Authorization","Basic "+btoa(k+":"+(A?OS(A):"")))}catch(M){throw Y.from(M,Y.ERR_BAD_OPTION_VALUE,r)}}if(P.isFormData(o)&&(dt.hasStandardBrowserEnv||dt.hasStandardBrowserWebWorkerEnv||P.isReactNative(o)?h.setContentType(void 0):P.isFunction(o.getHeaders)&&PS(h,o.getHeaders(),s("formDataHeaderPolicy"))),dt.hasStandardBrowserEnv&&(P.isFunction(l)&&(l=l(t)),l===!0||l==null&&ES(t.url))){const A=u&&d&&bS.read(d);A&&h.set(u,A)}return t}const AS=typeof XMLHttpRequest<"u",jS=AS&&function(r){return new Promise(function(s,o){const l=jy(r);let u=l.data;const d=vt.from(l.headers).normalize();let{responseType:h,onUploadProgress:m,onDownloadProgress:g}=l,v,x,k,A,M;function S(){A&&A(),M&&M(),l.cancelToken&&l.cancelToken.unsubscribe(v),l.signal&&l.signal.removeEventListener("abort",v)}let w=new XMLHttpRequest;w.open(l.method.toUpperCase(),l.url,!0),w.timeout=l.timeout;function b(){if(!w)return;const O=vt.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),W={data:!h||h==="text"||h==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:O,config:r,request:w};Oy(function(G){s(G),S()},function(G){o(G),S()},W),w=null}"onloadend"in w?w.onloadend=b:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.startsWith("file:"))||setTimeout(b)},w.onabort=function(){w&&(o(new Y("Request aborted",Y.ECONNABORTED,r,w)),S(),w=null)},w.onerror=function(j){const W=j&&j.message?j.message:"Network Error",$=new Y(W,Y.ERR_NETWORK,r,w);$.event=j||null,o($),S(),w=null},w.ontimeout=function(){let j=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const W=l.transitional||id;l.timeoutErrorMessage&&(j=l.timeoutErrorMessage),o(new Y(j,W.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,r,w)),S(),w=null},u===void 0&&d.setContentType(null),"setRequestHeader"in w&&P.forEach(by(d),function(j,W){w.setRequestHeader(W,j)}),P.isUndefined(l.withCredentials)||(w.withCredentials=!!l.withCredentials),h&&h!=="json"&&(w.responseType=l.responseType),g&&([k,M]=Ua(g,!0),w.addEventListener("progress",k)),m&&w.upload&&([x,A]=Ua(m),w.upload.addEventListener("progress",x),w.upload.addEventListener("loadend",A)),(l.cancelToken||l.signal)&&(v=O=>{w&&(o(!O||O.type?new oi(null,r,w):O),w.abort(),S(),w=null)},l.cancelToken&&l.cancelToken.subscribe(v),l.signal&&(l.signal.aborted?v():l.signal.addEventListener("abort",v)));const D=vS(l.url);if(D&&!dt.protocols.includes(D)){o(new Y("Unsupported protocol "+D+":",Y.ERR_BAD_REQUEST,r)),S();return}w.send(u||null)})},DS=(r,t)=>{if(r=r?r.filter(Boolean):[],!t&&!r.length)return;const s=new AbortController;let o=!1;const l=function(m){if(!o){o=!0,d();const g=m instanceof Error?m:this.reason;s.abort(g instanceof Y?g:new oi(g instanceof Error?g.message:g))}};let u=t&&setTimeout(()=>{u=null,l(new Y(`timeout of ${t}ms exceeded`,Y.ETIMEDOUT))},t);const d=()=>{r&&(u&&clearTimeout(u),u=null,r.forEach(m=>{m.unsubscribe?m.unsubscribe(l):m.removeEventListener("abort",l)}),r=null)};r.forEach(m=>m.addEventListener("abort",l,{once:!0}));const{signal:h}=s;return h.unsubscribe=()=>P.asap(d),h},LS=function*(r,t){let s=r.byteLength;if(s{const l=IS(r,t);let u=0,d,h=m=>{d||(d=!0,o&&o(m))};return new ReadableStream({async pull(m){try{const{done:g,value:v}=await l.next();if(g){h(),m.close();return}let x=v.byteLength;if(s){let k=u+=x;s(k)}m.enqueue(new Uint8Array(v))}catch(g){throw h(g),g}},cancel(m){return h(m),l.return()}},{highWaterMark:2})},za=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,MS=(r,t,s)=>t+2A>=2&&o.charCodeAt(A-2)===37&&o.charCodeAt(A-1)===51&&(o.charCodeAt(A)===68||o.charCodeAt(A)===100);g>=0&&(o.charCodeAt(g)===61?(m++,g--):v(g)&&(m++,g-=3)),m===1&&g>=0&&(o.charCodeAt(g)===61||v(g))&&m++;const k=Math.floor(d/4)*3-(m||0);return k>0?k:0}let u=0;for(let d=0,h=o.length;d=55296&&m<=56319&&d+1=56320&&g<=57343?(u+=4,d++):u+=3}else u+=3}return u}const ld="1.18.1",am=64*1024,{isFunction:Ea}=P,zS=r=>encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(t,s)=>String.fromCharCode(parseInt(s,16))),lm=r=>{if(!P.isString(r))return r;try{return decodeURIComponent(r)}catch{return r}},um=(r,...t)=>{try{return!!r(...t)}catch{return!1}},BS=r=>{const t=r.indexOf("://");let s=r;return t!==-1&&(s=s.slice(t+3)),s.includes("@")||s.includes(":")},$S=r=>{const t=P.global!==void 0&&P.global!==null?P.global:globalThis,{ReadableStream:s,TextEncoder:o}=t;r=P.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},r);const{fetch:l,Request:u,Response:d}=r,h=l?Ea(l):typeof fetch=="function",m=Ea(u),g=Ea(d);if(!h)return!1;const v=h&&Ea(s),x=h&&(typeof o=="function"?(b=>D=>b.encode(D))(new o):async b=>new Uint8Array(await new u(b).arrayBuffer())),k=m&&v&&um(()=>{let b=!1;const D=new u(dt.origin,{body:new s,method:"POST",get duplex(){return b=!0,"half"}}),O=D.headers.has("Content-Type");return D.body!=null&&D.body.cancel(),b&&!O}),A=g&&v&&um(()=>P.isReadableStream(new d("").body)),M={stream:A&&(b=>b.body)};h&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!M[b]&&(M[b]=(D,O)=>{let j=D&&D[b];if(j)return j.call(D);throw new Y(`Response type '${b}' is not supported`,Y.ERR_NOT_SUPPORT,O)})});const S=async b=>{if(b==null)return 0;if(P.isBlob(b))return b.size;if(P.isSpecCompliantForm(b))return(await new u(dt.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(P.isArrayBufferView(b)||P.isArrayBuffer(b))return b.byteLength;if(P.isURLSearchParams(b)&&(b=b+""),P.isString(b))return(await x(b)).byteLength},w=async(b,D)=>{const O=P.toFiniteNumber(b.getContentLength());return O??S(D)};return async b=>{let{url:D,method:O,data:j,signal:W,cancelToken:$,timeout:G,onDownloadProgress:B,onUploadProgress:ie,responseType:ue,headers:Ee,withCredentials:Te="same-origin",fetchOptions:we,maxContentLength:J,maxBodyLength:Se}=jy(b);const be=P.isNumber(J)&&J>-1,_e=P.isNumber(Se)&&Se>-1,K=X=>P.hasOwnProp(b,X)?b[X]:void 0;let ae=l||fetch;ue=ue?(ue+"").toLowerCase():"text";let U=DS([W,$&&$.toAbortSignal()],G),N=null;const z=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let ce,me=null;const he=()=>new Y("Request body larger than maxBodyLength limit",Y.ERR_BAD_REQUEST,b,N);try{let X;const ve=K("auth");if(ve){const xe=P.getSafeProp(ve,"username")||"",it=P.getSafeProp(ve,"password")||"";X={username:xe,password:it}}if(BS(D)){const xe=new URL(D,dt.origin);if(!X&&(xe.username||xe.password)){const it=lm(xe.username),Xt=lm(xe.password);X={username:it,password:Xt}}(xe.username||xe.password)&&(xe.username="",xe.password="",D=xe.href)}if(X&&(Ee.delete("authorization"),Ee.set("Authorization","Basic "+btoa(zS((X.username||"")+":"+(X.password||""))))),be&&typeof D=="string"&&D.startsWith("data:")&&US(D)>J)throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,b,N);if(_e&&O!=="get"&&O!=="head"){const xe=await S(j);if(typeof xe=="number"&&isFinite(xe)&&(ce=xe,xe>Se))throw he()}const Re=_e&&(P.isReadableStream(j)||P.isStream(j)),ye=(xe,it,Xt)=>im(xe,am,Yt=>{if(_e&&Yt>Se)throw me=he();it&&it(Yt)},Xt);if(k&&O!=="get"&&O!=="head"&&(ie||Re)){if(ce=ce??await w(Ee,j),ce!==0||Re){let xe=new u(D,{method:"POST",body:j,duplex:"half"}),it;if(P.isFormData(j)&&(it=xe.headers.get("content-type"))&&Ee.setContentType(it),xe.body){const[Xt,Yt]=ie&&nm(ce,Ua(rm(ie)))||[];j=ye(xe.body,Xt,Yt)}}}else if(Re&&!m&&v&&O!=="get"&&O!=="head")j=ye(j);else if(Re&&m&&!k&&O!=="get"&&O!=="head")throw new Y("Stream request bodies are not supported by the current fetch implementation",Y.ERR_NOT_SUPPORT,b,N);P.isString(Te)||(Te=Te?"include":"omit");const et=m&&"credentials"in u.prototype;if(P.isFormData(j)){const xe=Ee.getContentType();xe&&/^multipart\/form-data/i.test(xe)&&!/boundary=/i.test(xe)&&Ee.delete("content-type")}Ee.set("User-Agent","axios/"+ld,!1);const Ft={...we,signal:U,method:O.toUpperCase(),headers:by(Ee.normalize()),body:j,duplex:"half",credentials:et?Te:void 0};N=m&&new u(D,Ft);let ot=await(m?ae(N,we):ae(D,Ft));const Gt=vt.from(ot.headers);if(be){const xe=P.toFiniteNumber(Gt.getContentLength());if(xe!=null&&xe>J)throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,b,N)}const Mt=A&&(ue==="stream"||ue==="response");if(A&&ot.body&&(B||be||Mt&&z)){const xe={};["status","statusText","headers"].forEach(Sn=>{xe[Sn]=ot[Sn]});const it=P.toFiniteNumber(Gt.getContentLength()),[Xt,Yt]=B&&nm(it,Ua(rm(B),!0))||[];let Fn=0;const Mn=Sn=>{if(be&&(Fn=Sn,Fn>J))throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,b,N);Xt&&Xt(Sn)};ot=new d(im(ot.body,am,Mn,()=>{Yt&&Yt(),z&&z()}),xe)}ue=ue||"text";let Ut=await M[P.findKey(M,ue)||"text"](ot,b);if(be&&!A&&!Mt){let xe;if(Ut!=null&&(typeof Ut.byteLength=="number"?xe=Ut.byteLength:typeof Ut.size=="number"?xe=Ut.size:typeof Ut=="string"&&(xe=typeof o=="function"?new o().encode(Ut).byteLength:Ut.length)),typeof xe=="number"&&xe>J)throw new Y("maxContentLength size of "+J+" exceeded",Y.ERR_BAD_RESPONSE,b,N)}return!Mt&&z&&z(),await new Promise((xe,it)=>{Oy(xe,it,{data:Ut,headers:vt.from(ot.headers),status:ot.status,statusText:ot.statusText,config:b,request:N})})}catch(X){if(z&&z(),U&&U.aborted&&U.reason instanceof Y){const ve=U.reason;throw ve.config=b,N&&(ve.request=N),X!==ve&&Object.defineProperty(ve,"cause",{__proto__:null,value:X,writable:!0,enumerable:!1,configurable:!0}),ve}if(me)throw N&&!me.request&&(me.request=N),me;if(X instanceof Y)throw N&&!X.request&&(X.request=N),X;if(X&&X.name==="TypeError"&&/Load failed|fetch/i.test(X.message)){const ve=new Y("Network Error",Y.ERR_NETWORK,b,N,X&&X.response);throw Object.defineProperty(ve,"cause",{__proto__:null,value:X.cause||X,writable:!0,enumerable:!1,configurable:!0}),ve}throw Y.from(X,X&&X.code,b,N,X&&X.response)}}},VS=new Map,Dy=r=>{let t=r&&r.env||{};const{fetch:s,Request:o,Response:l}=t,u=[o,l,s];let d=u.length,h=d,m,g,v=VS;for(;h--;)m=u[h],g=v.get(m),g===void 0&&v.set(m,g=h?new Map:$S(t)),v=g;return g};Dy();const ud={http:nS,xhr:jS,fetch:{get:Dy}};P.forEach(ud,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(r,"adapterName",{__proto__:null,value:t})}});const cm=r=>`- ${r}`,WS=r=>P.isFunction(r)||r===null||r===!1;function qS(r,t){r=P.isArray(r)?r:[r];const{length:s}=r;let o,l;const u={};for(let d=0;d`adapter ${m} `+(g===!1?"is not supported by the environment":"is not available in the build"));let h=s?d.length>1?`since : `+d.map(cm).join(` `):" "+cm(d[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+h,Y.ERR_NOT_SUPPORT)}return l}const Ly={getAdapter:qS,adapters:ud};function Yu(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new oi(null,r)}function dm(r){return Yu(r),r.headers=vt.from(r.headers),r.data=Xu.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Ly.getAdapter(r.adapter||si.adapter,r)(r).then(function(o){Yu(r),r.response=o;try{o.data=Xu.call(r,r.transformResponse,o)}finally{delete r.response}return o.headers=vt.from(o.headers),o},function(o){if(!Py(o)&&(Yu(r),o&&o.response)){r.response=o.response;try{o.response.data=Xu.call(r,r.transformResponse,o.response)}finally{delete r.response}o.response.headers=vt.from(o.response.headers)}return Promise.reject(o)})}const Ha={};["object","boolean","number","function","string","symbol"].forEach((r,t)=>{Ha[r]=function(o){return typeof o===r||"a"+(t<1?"n ":" ")+r}});const fm={};Ha.transitional=function(t,s,o){function l(u,d){return"[Axios v"+ld+"] Transitional option '"+u+"'"+d+(o?". "+o:"")}return(u,d,h)=>{if(t===!1)throw new Y(l(d," has been removed"+(s?" in "+s:"")),Y.ERR_DEPRECATED);return s&&!fm[d]&&(fm[d]=!0,console.warn(l(d," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(u,d,h):!0}};Ha.spelling=function(t){return(s,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function HS(r,t,s){if(typeof r!="object"||r===null)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const o=Object.keys(r);let l=o.length;for(;l-- >0;){const u=o[l],d=Object.prototype.hasOwnProperty.call(t,u)?t[u]:void 0;if(d){const h=r[u],m=h===void 0||d(h,u,r);if(m!==!0)throw new Y("option "+u+" must be "+m,Y.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new Y("Unknown option "+u,Y.ERR_BAD_OPTION)}}const Na={assertOptions:HS,validators:Ha},gt=Na.validators;let Kr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new em,response:new em}}async request(t,s){try{return await this._request(t,s)}catch(o){if(o instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const u=(()=>{if(!l.stack)return"";const d=l.stack.indexOf(` `);return d===-1?"":l.stack.slice(d+1)})();try{if(!o.stack)o.stack=u;else if(u){const d=u.indexOf(` `),h=d===-1?-1:u.indexOf(` `,d+1),m=h===-1?"":u.slice(h+1);String(o.stack).endsWith(m)||(o.stack+=` `+u)}}catch{}}throw o}}_request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=es(this.defaults,s);const{transitional:o,paramsSerializer:l,headers:u}=s;o!==void 0&&Na.assertOptions(o,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean),legacyInterceptorReqResOrdering:gt.transitional(gt.boolean),advertiseZstdAcceptEncoding:gt.transitional(gt.boolean),validateStatusUndefinedResolves:gt.transitional(gt.boolean)},!1),l!=null&&(P.isFunction(l)?s.paramsSerializer={serialize:l}:Na.assertOptions(l,{encode:gt.function,serialize:gt.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),Na.assertOptions(s,{baseUrl:gt.spelling("baseURL"),withXsrfToken:gt.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let d=u&&P.merge(u.common,u[s.method]);u&&P.forEach(["delete","get","head","post","put","patch","query","common"],M=>{delete u[M]}),s.headers=vt.concat(d,u);const h=[];let m=!0;this.interceptors.request.forEach(function(S){if(typeof S.runWhen=="function"&&S.runWhen(s)===!1)return;m=m&&S.synchronous;const w=s.transitional||id;w&&w.legacyInterceptorReqResOrdering?h.unshift(S.fulfilled,S.rejected):h.push(S.fulfilled,S.rejected)});const g=[];this.interceptors.response.forEach(function(S){g.push(S.fulfilled,S.rejected)});let v,x=0,k;if(!m){const M=[dm.bind(this),void 0];for(M.unshift(...h),M.push(...g),k=M.length,v=Promise.resolve(s);x{if(!o._listeners)return;let u=o._listeners.length;for(;u-- >0;)o._listeners[u](l);o._listeners=null}),this.promise.then=l=>{let u;const d=new Promise(h=>{o.subscribe(h),u=h}).then(l);return d.cancel=function(){o.unsubscribe(u)},d},t(function(u,d,h){o.reason||(o.reason=new oi(u,d,h),s(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const t=new AbortController,s=o=>{t.abort(o)};return this.subscribe(s),t.signal.unsubscribe=()=>this.unsubscribe(s),t.signal}static source(){let t;return{token:new Iy(function(l){t=l}),cancel:t}}};function KS(r){return function(s){return r.apply(null,s)}}function GS(r){return P.isObject(r)&&r.isAxiosError===!0}const Oc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Oc).forEach(([r,t])=>{Oc[t]=r});function Fy(r){const t=new Kr(r),s=hy(Kr.prototype.request,t);return P.extend(s,Kr.prototype,t,{allOwnKeys:!0}),P.extend(s,t,null,{allOwnKeys:!0}),s.create=function(l){return Fy(es(r,l))},s}const Ke=Fy(si);Ke.Axios=Kr;Ke.CanceledError=oi;Ke.CancelToken=QS;Ke.isCancel=Py;Ke.VERSION=ld;Ke.toFormData=qa;Ke.AxiosError=Y;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=KS;Ke.isAxiosError=GS;Ke.mergeConfig=es;Ke.AxiosHeaders=vt;Ke.formToJSON=r=>Ny(P.isHTMLForm(r)?new FormData(r):r);Ke.getAdapter=Ly.getAdapter;Ke.HttpStatusCode=Oc;Ke.default=Ke;const{Axios:FC,AxiosError:MC,CanceledError:UC,isCancel:zC,CancelToken:BC,VERSION:$C,all:VC,Cancel:WC,isAxiosError:qC,spread:HC,toFormData:QC,AxiosHeaders:KC,HttpStatusCode:GC,formToJSON:XC,getAdapter:YC,mergeConfig:JC,create:ZC}=Ke,My=typeof window>"u",hm=!My&&window.self!==window.top,XS=!My&&typeof document>"u",Ju=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),ut=[];for(let r=0;r<256;++r)ut.push((r+256).toString(16).slice(1));function YS(r,t=0){return(ut[r[t+0]]+ut[r[t+1]]+ut[r[t+2]]+ut[r[t+3]]+"-"+ut[r[t+4]]+ut[r[t+5]]+"-"+ut[r[t+6]]+ut[r[t+7]]+"-"+ut[r[t+8]]+ut[r[t+9]]+"-"+ut[r[t+10]]+ut[r[t+11]]+ut[r[t+12]]+ut[r[t+13]]+ut[r[t+14]]+ut[r[t+15]]).toLowerCase()}let Zu;const JS=new Uint8Array(16);function ZS(){if(!Zu){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Zu=crypto.getRandomValues.bind(crypto)}return Zu(JS)}const e_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),pm={randomUUID:e_};function t_(r,t,s){var l;r=r||{};const o=r.random??((l=r.rng)==null?void 0:l.call(r))??ZS();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,YS(o)}function n_(r,t,s){return pm.randomUUID&&!r?pm.randomUUID():t_(r)}const Lo=typeof window<"u"?window:{base44SharedInstances:{}};function r_(r,t){return Lo.base44SharedInstances||(Lo.base44SharedInstances={}),Lo.base44SharedInstances[r]||(Lo.base44SharedInstances[r]={instance:t()}),Lo.base44SharedInstances[r].instance}const s_="__user_heartbeat_event__",o_="__initialization_event__",i_="__session_duration_event__",mm="analytics-enable",gm="base44_analytics_session_id",a_={enabled:!0,maxQueueSize:1e3,throttleTime:1e3,batchSize:30,heartBeatInterval:60*1e3},l_="analytics",Fe=r_(l_,()=>({requestsQueue:[],isProcessing:!1,isHeartBeatProcessing:!1,wasInitializationTracked:!1,sessionContext:null,sessionStartTime:null,config:{...a_,...g_()}})),u_=({axiosClient:r,serverUrl:t,appId:s,userAuthModule:o})=>{var l;const{maxQueueSize:u,throttleTime:d,batchSize:h}=Fe.config;if(!(!((l=Fe.config)===null||l===void 0)&&l.enabled)||XS)return{track:()=>{},cleanup:()=>{}};let m;const g=`${t}/api/apps/${s}/analytics/track/batch`,v=async O=>{await r.request({method:"POST",url:`/apps/${s}/analytics/track/batch`,data:{events:O}})},x=O=>{try{const j=JSON.stringify({events:O}),W=new Blob([j],{type:"application/json"});return typeof navigator>"u"||j.length>6e4||!navigator.sendBeacon(g,W)}catch{return!1}},k=async(O,j={})=>{if(O.length===0)return;const W=await m_(o),$=O.map(p_(W));try{(!j.isBeacon||!x($))&&await v($)}catch{}},A=()=>{vm(k,{throttleTime:d,batchSize:h})},M=O=>{if(Fe.requestsQueue.length>=u)return;const j=h_();Fe.requestsQueue.push({...O,...j}),A()},S=()=>{vm(k,{throttleTime:d,batchSize:h}),m=xm(M),d_()},w=()=>{ym(),m==null||m(),f_(M);const O=Fe.requestsQueue.splice(0);k(O,{isBeacon:!0})},b=()=>{typeof window>"u"||(document.visibilityState==="hidden"?w():document.visibilityState==="visible"&&S())},D=()=>{ym(),m==null||m(),typeof window<"u"&&window.removeEventListener("visibilitychange",b)};return A(),m=xm(M),c_(M),typeof window<"u"&&window.addEventListener("visibilitychange",b),{track:M,cleanup:D}};function ym(){Fe.isProcessing=!1}async function vm(r,t){if(Fe.isProcessing)return;Fe.isProcessing=!0;const{throttleTime:s=1e3,batchSize:o=30}=t??{};for(;Fe.isProcessing&&Fe.requestsQueue.length>0;){const l=Fe.requestsQueue.splice(0,o);l.length&&await r(l),await new Promise(u=>setTimeout(u,s))}Fe.isProcessing=!1}function xm(r){var t;if(Fe.isHeartBeatProcessing||((t=Fe.config.heartBeatInterval)!==null&&t!==void 0?t:0)<10)return()=>{};Fe.isHeartBeatProcessing=!0;const s=setInterval(()=>{r({eventName:s_})},Fe.config.heartBeatInterval);return()=>{clearInterval(s),Fe.isHeartBeatProcessing=!1}}function c_(r){typeof window>"u"||Fe.wasInitializationTracked||(Fe.wasInitializationTracked=!0,r({eventName:o_,properties:{referrer:document==null?void 0:document.referrer}}))}function d_(){typeof window>"u"||Fe.sessionStartTime!==null||(Fe.sessionStartTime=new Date().toISOString())}function f_(r){if(typeof window>"u"||Fe.sessionStartTime===null)return;const t=new Date().getTime()-new Date(Fe.sessionStartTime).getTime();Fe.sessionStartTime=null,r({eventName:i_,properties:{sessionDuration:t}})}function h_(){return{timestamp:new Date().toISOString(),pageUrl:typeof window<"u"?window.location.pathname:null}}function p_(r){return t=>({event_name:t.eventName,properties:t.properties,timestamp:t.timestamp,page_url:t.pageUrl,...r})}let ec=null;async function m_(r){if(!Fe.sessionContext){if(!ec){const t=cd();ec=r.me().then(s=>({user_id:s.id,session_id:t})).catch(()=>({user_id:null,session_id:t}))}Fe.sessionContext=await ec}return Fe.sessionContext}function g_(){if(typeof window>"u"||!window.location)return;const t=new URLSearchParams(window.location.search).get(mm);if(t==null||!t.length)return;const s=new URLSearchParams(window.location.search);s.delete(mm);const o=window.location.pathname+(s.toString()?"?"+s.toString():"");return window.history.replaceState({},"",o),{enabled:t==="true"}}function cd(){if(typeof window>"u")return Ju();try{const r=localStorage.getItem(gm);if(!r){const t=Ju();return localStorage.setItem(gm,t),t}return r}catch{return Ju()}}class y_ extends Error{constructor(t,s,o,l,u){super(t),this.name="Base44Error",this.status=s,this.code=o,this.data=l,this.originalError=u}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code,data:this.data}}}function Mo({baseURL:r,headers:t={},token:s,interceptResponses:o=!0,onError:l}){const u=Ke.create({baseURL:r,headers:{"Content-Type":"application/json",Accept:"application/json",...t}});return s&&(u.defaults.headers.common.Authorization=`Bearer ${s}`),u.interceptors.request.use(d=>{typeof window<"u"&&window.location&&(d.headers.set("X-Origin-URL",window.location.href),d.headers.get("Authorization")||d.headers.set("X-Base44-Anonymous-Id",cd()));const h=n_();if(d.requestId=h,hm)try{window.parent.postMessage({type:"api-request-start",requestId:h,data:{url:r+d.url,method:d.method,body:d.data instanceof FormData?"[FormData object]":d.data}},"*")}catch{}return d}),o&&u.interceptors.response.use(d=>{var h;const m=(h=d.config)===null||h===void 0?void 0:h.requestId;try{hm&&m&&window.parent.postMessage({type:"api-request-end",requestId:m,data:{statusCode:d.status,response:d.data}},"*")}catch{}return d.data},d=>{var h,m,g,v,x,k,A,M;const S=((m=(h=d.response)===null||h===void 0?void 0:h.data)===null||m===void 0?void 0:m.message)||((v=(g=d.response)===null||g===void 0?void 0:g.data)===null||v===void 0?void 0:v.detail)||d.message,w=new y_(S,(x=d.response)===null||x===void 0?void 0:x.status,(A=(k=d.response)===null||k===void 0?void 0:k.data)===null||A===void 0?void 0:A.code,(M=d.response)===null||M===void 0?void 0:M.data,d);return l==null||l(w),Promise.reject(w)}),u}function wm(r){const{axios:t,appId:s,getSocket:o}=r;return new Proxy({},{get(l,u){if(!(typeof u!="string"||u==="then"||u.startsWith("_")))return x_(t,s,u,o)}})}function v_(r){var t;try{const s=JSON.parse(r);return{type:s.type,data:s.data,id:s.id||((t=s.data)===null||t===void 0?void 0:t.id),timestamp:s.timestamp||new Date().toISOString()}}catch(s){return console.warn("[Base44 SDK] Failed to parse realtime message:",s),null}}function x_(r,t,s,o){const l=`/apps/${t}/entities/${s}`;return{async list(u,d,h,m){const g={};return u&&(g.sort=u),d&&(g.limit=d),h&&(g.skip=h),m&&(g.fields=Array.isArray(m)?m.join(","):m),r.get(l,{params:g})},async filter(u,d,h,m,g){const v={q:JSON.stringify(u)};return d&&(v.sort=d),h&&(v.limit=h),m&&(v.skip=m),g&&(v.fields=Array.isArray(g)?g.join(","):g),r.get(l,{params:v})},async get(u){return r.get(`${l}/${u}`)},async create(u){return r.post(l,u)},async update(u,d){return r.put(`${l}/${u}`,d)},async delete(u){return r.delete(`${l}/${u}`)},async deleteMany(u){return r.delete(l,{data:u})},async bulkCreate(u){return r.post(`${l}/bulk`,u)},async updateMany(u,d){return r.patch(`${l}/update-many`,{query:u,data:d})},async bulkUpdate(u){return r.put(`${l}/bulk`,u)},async importEntities(u){const d=new FormData;return d.append("file",u,u.name),r.post(`${l}/import`,d,{headers:{"Content-Type":"multipart/form-data"}})},subscribe(u){const d=`entities:${t}:${s}`;return o().subscribeToRoom(d,{update_model:g=>{var v;const x=v_(g.data);if(x){x.type!=="delete"&&(!((v=x.data)===null||v===void 0)&&v._oversize)&&console.error(`[Base44 SDK] Realtime broadcast for ${s}#${x.id} was oversize and got slimmed for transport. Fields >10 KB are empty and the rest of the record may be a stub. Call \`entities.${s}.get("${x.id}")\` to fetch the full record.`);try{u(x)}catch(k){console.error("[Base44 SDK] Subscription callback error:",k)}}}})}}}function w_(r,t){return{async call(s,o,l){if(!(s!=null&&s.trim()))throw new Error("Integration slug is required and cannot be empty");if(!(o!=null&&o.trim()))throw new Error("Operation ID is required and cannot be empty");const{pathParams:u,queryParams:d,...h}=l??{},m={...h,...u&&{path_params:u},...d&&{query_params:d}};return await r.post(`/apps/${t}/integrations/custom/${s}/${o}`,m)}}}function Em(r,t){const s=w_(r,t);return new Proxy({},{get(o,l){if(!(typeof l!="string"||l==="then"||l.startsWith("_")))return l==="custom"?s:new Proxy({},{get(u,d){if(!(typeof d!="string"||d==="then"||d.startsWith("_")))return async h=>{if(typeof h=="string")throw new Error(`Integration ${d} must receive an object with named parameters, received: ${h}`);let m,g;return h instanceof FormData||h&&Object.values(h).some(v=>v instanceof File)?(m=new FormData,Object.keys(h).forEach(v=>{h[v]instanceof File?m.append(v,h[v],h[v].name):typeof h[v]=="object"&&h[v]!==null?m.append(v,JSON.stringify(h[v])):m.append(v,h[v])}),g="multipart/form-data"):(m=h,g="application/json"),l==="Core"?r.post(`/apps/${t}/integration-endpoints/Core/${d}`,m||h,{headers:{"Content-Type":g}}):r.post(`/apps/${t}/integration-endpoints/installable/${l}/integration-endpoints/${d}`,m||h,{headers:{"Content-Type":g}})}}})}})}function E_(){return typeof window>"u"?!1:window!==window.parent}function b_(r,t,s){const u=Math.round(window.screenX+(window.outerWidth-500)/2),d=Math.round(window.screenY+(window.outerHeight-600)/2),h=window.open(r,"base44_auth",`width=500,height=600,left=${u},top=${d},resizable=yes,scrollbars=yes`);if(!h)return;const m=()=>{window.removeEventListener("message",g),clearInterval(v),h.closed||h.close()},g=x=>{var k;if(x.origin!==s||x.source!==h||!(!((k=x.data)===null||k===void 0)&&k.access_token))return;m();const A=new URL(t),{access_token:M,is_new_user:S}=x.data;A.searchParams.set("access_token",M),S!=null&&A.searchParams.set("is_new_user",String(S)),window.location.href=A.toString()},v=setInterval(()=>{h.closed&&m()},500);window.addEventListener("message",g)}function S_(r,t,s,o){return{async me(){return r.get(`/apps/${s}/entities/User/me`)},async updateMe(l){return r.put(`/apps/${s}/entities/User/me`,l)},redirectToLogin(l){if(typeof window>"u")throw new Error("Login method can only be used in a browser environment");const u=l?new URL(l,window.location.origin).toString():window.location.href,d=`${o.appBaseUrl}/login?from_url=${encodeURIComponent(u)}`;window.location.href=d},loginWithProvider(l,u="/"){const d=new URL(u,window.location.origin).toString(),h=`app_id=${s}&from_url=${encodeURIComponent(d)}`;let m;l==="sso"?m=`/apps/${s}/auth/sso/login`:m=`/apps/auth${l==="google"?"":`/${l}`}/login`;const g=`${o.appBaseUrl}/api${m}?${h}`;if(E_()){const v=`${g}&popup_origin=${encodeURIComponent(window.location.origin)}`;return b_(v,d,window.location.origin)}window.location.href=g},logout(l){if(delete r.defaults.headers.common.Authorization,typeof window<"u"){if(window.localStorage)try{window.localStorage.removeItem("base44_access_token"),window.localStorage.removeItem("token")}catch(h){console.error("Failed to remove token from localStorage:",h)}const u=l||window.location.href,d=`${o.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(u)}`;window.location.href=d}},setToken(l,u=!0){if(l&&(r.defaults.headers.common.Authorization=`Bearer ${l}`,t.defaults.headers.common.Authorization=`Bearer ${l}`,u&&typeof window<"u"&&window.localStorage))try{window.localStorage.setItem("base44_access_token",l),window.localStorage.setItem("token",l)}catch(d){console.error("Failed to save token to localStorage:",d)}},async loginViaEmailPassword(l,u,d){var h;try{const m=await r.post(`/apps/${s}/auth/login`,{email:l,password:u,...d&&{turnstile_token:d}}),{access_token:g,user:v}=m;return g&&this.setToken(g),{access_token:g,user:v}}catch(m){throw((h=m.response)===null||h===void 0?void 0:h.status)===401&&await this.logout(),m}},async isAuthenticated(){try{return await this.me(),!0}catch{return!1}},inviteUser(l,u){return r.post(`/apps/${s}/users/invite-user`,{user_email:l,role:u})},register(l){return r.post(`/apps/${s}/auth/register`,l)},verifyOtp({email:l,otpCode:u}){return r.post(`/apps/${s}/auth/verify-otp`,{email:l,otp_code:u})},resendOtp(l){return r.post(`/apps/${s}/auth/resend-otp`,{email:l})},resetPasswordRequest(l){return r.post(`/apps/${s}/auth/reset-password-request`,{email:l})},resetPassword({resetToken:l,newPassword:u}){return r.post(`/apps/${s}/auth/reset-password`,{reset_token:l,new_password:u})},changePassword({userId:l,currentPassword:u,newPassword:d}){return r.post(`/apps/${s}/auth/change-password`,{user_id:l,current_password:u,new_password:d})}}}function __(r,t){return{async getAccessToken(s){const o=`/apps/${t}/auth/sso/accesstoken/${s}`;return r.get(o)},async getIdToken(s){const o=`/apps/${t}/auth/sso/idtoken/${s}`;return r.get(o)}}}function k_(r,t){return{async getAccessToken(s){if(!s||typeof s!="string")throw new Error("Integration type is required and must be a string");return(await r.get(`/apps/${t}/external-auth/tokens/${s}`)).access_token},async getConnection(s){var o;if(!s||typeof s!="string")throw new Error("Integration type is required and must be a string");const u=await r.get(`/apps/${t}/external-auth/tokens/${s}`);return{accessToken:u.access_token,connectionConfig:(o=u.connection_config)!==null&&o!==void 0?o:null}},async getWorkspaceConnection(s){var o;if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");const u=await r.get(`/apps/${t}/external-auth/tokens/connectors/${s}`);return{accessToken:u.access_token,connectionConfig:(o=u.connection_config)!==null&&o!==void 0?o:null}},async getCurrentAppUserAccessToken(s){if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");return(await r.get(`/apps/${t}/app-user-auth/connectors/${s}/token`)).access_token},async getCurrentAppUserConnection(s){var o;if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");const u=await r.get(`/apps/${t}/app-user-auth/connectors/${s}/token`);return{accessToken:u.access_token,connectionConfig:(o=u.connection_config)!==null&&o!==void 0?o:null}}}}function C_(r,t){return{async connectAppUser(s){if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");return(await r.post(`/apps/${t}/app-user-auth/connectors/${s}/initiate`)).redirect_url},async disconnectAppUser(s){if(!s||typeof s!="string")throw new Error("Connector ID is required and must be a string");await r.delete(`/apps/${t}/app-user-auth/connectors/${s}`)}}}function Gr(r={}){const{storageKey:t="base44_access_token",paramName:s="access_token",saveToStorage:o=!0,removeFromUrl:l=!0}=r;let u=null;if(typeof window<"u"&&window.location)try{const d=new URLSearchParams(window.location.search);if(u=d.get(s),u){if(o&&R_(u,{storageKey:t}),l){d.delete(s);const h=`${window.location.pathname}${d.toString()?`?${d.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,h)}return u}}catch(d){console.error("Error retrieving token from URL:",d)}if(typeof window<"u"&&window.localStorage)try{return u=window.localStorage.getItem(t),u}catch(d){console.error("Error retrieving token from local storage:",d)}return null}function R_(r,t){const{storageKey:s="base44_access_token"}=t;if(typeof window>"u"||!window.localStorage||!r)return!1;try{return window.localStorage.setItem(s,r),window.localStorage.setItem("token",r),!0}catch(o){return console.error("Error saving token to local storage:",o),!1}}function bm(r,t,s){const o=(u,d)=>u?`${String(u).replace(/\/$/,"")}${d}`:d,l=u=>{const d=new Headers;if(s!=null&&s.getAuthHeaders){const h=s.getAuthHeaders();Object.entries(h).forEach(([m,g])=>{g!=null&&d.set(m,String(g))})}return u&&new Headers(u).forEach((h,m)=>{d.set(m,h)}),d};return{async invoke(u,d){if(typeof d=="string")throw new Error(`Function ${u} must receive an object with named parameters, received: ${d}`);let h,m;return d instanceof FormData||d&&Object.values(d).some(g=>g instanceof File)?(h=new FormData,Object.keys(d).forEach(g=>{d[g]instanceof File?h.append(g,d[g],d[g].name):typeof d[g]=="object"&&d[g]!==null?h.append(g,JSON.stringify(d[g])):h.append(g,d[g])}),m="multipart/form-data"):(h=d,m="application/json"),r.post(`/apps/${t}/functions/${u}`,h||d,{headers:{"Content-Type":m}})},async fetch(u,d={}){const m=`/functions${u.startsWith("/")?u:`/${u}`}`,g=l(d.headers),v={...d,headers:g};return await fetch(o(s==null?void 0:s.baseURL,m),v)}}}function Sm({axios:r,getSocket:t,appId:s,serverUrl:o,token:l}){const u=`/apps/${s}/agents`,d={},h=()=>r.get(`${u}/conversations`),m=S=>r.get(`${u}/conversations/${S}`);return{getConversations:h,getConversation:m,listConversations:S=>r.get(`${u}/conversations`,{params:S}),createConversation:S=>r.post(`${u}/conversations`,S),addMessage:async(S,w)=>r.post(`${u}/conversations/v2/${S.id}/messages`,w),subscribeToConversation:(S,w)=>{const b=`/agent-conversations/${S}`,D=t(),O=m(S).then(j=>(d[S]=j,j));return D.subscribeToRoom(b,{connect:()=>{},update_model:async({data:j})=>{const W=JSON.parse(j);if(W._message){await O;const $=W._message,G=d[S];if(G){const B=G.messages||[],ie=B.findIndex(Ee=>Ee.id===$.id),ue=ie!==-1?B.map((Ee,Te)=>Te===ie?$:Ee):[...B,$];d[S]={...G,messages:ue},w==null||w(d[S])}}}})},getWhatsAppConnectURL:S=>{const w=`${o}/api/apps/${s}/agents/${encodeURIComponent(S)}/whatsapp`,b=l??Gr();return b?`${w}?token=${b}`:w},getTelegramConnectURL:S=>{const w=`${o}/api/apps/${s}/agents/${encodeURIComponent(S)}/telegram`,b=l??Gr();return b?`${w}?token=${b}`:w}}}function _m({serverUrl:r,token:t,appId:s}){return{connection:()=>{var l;return{baseURL:`${r}/api/apps/${s}/ai/openai/v1`,token:(l=t??Gr())!==null&&l!==void 0?l:""}}}}function km(r,t){const s=`/app-logs/${t}`;return{async logUserInApp(o){await r.post(`${s}/log-user-in-app/${o}`)},async fetchLogs(o={}){return await r.get(s,{params:o})},async getStats(o={}){return await r.get(`${s}/stats`,{params:o})}}}function T_(r,t){return{async inviteUser(s,o){if(o!=="user"&&o!=="admin")throw new Error(`Invalid role: "${o}". Role must be either "user" or "admin".`);return await r.post(`/apps/${t}/runtime/users/invite-user`,{user_email:s,role:o})}}}const En=Object.create(null);En.open="0";En.close="1";En.ping="2";En.pong="3";En.message="4";En.upgrade="5";En.noop="6";const Pa=Object.create(null);Object.keys(En).forEach(r=>{Pa[En[r]]=r});const Ac={type:"error",data:"parser error"},Uy=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",zy=typeof ArrayBuffer=="function",By=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,dd=({type:r,data:t},s,o)=>Uy&&t instanceof Blob?s?o(t):Cm(t,o):zy&&(t instanceof ArrayBuffer||By(t))?s?o(t):Cm(new Blob([t]),o):o(En[r]+(t||"")),Cm=(r,t)=>{const s=new FileReader;return s.onload=function(){const o=s.result.split(",")[1];t("b"+(o||""))},s.readAsDataURL(r)};function Rm(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let tc;function N_(r,t){if(Uy&&r.data instanceof Blob)return r.data.arrayBuffer().then(Rm).then(t);if(zy&&(r.data instanceof ArrayBuffer||By(r.data)))return t(Rm(r.data));dd(r,!1,s=>{tc||(tc=new TextEncoder),t(tc.encode(s))})}const Tm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Uo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r{let t=r.length*.75,s=r.length,o,l=0,u,d,h,m;r[r.length-1]==="="&&(t--,r[r.length-2]==="="&&t--);const g=new ArrayBuffer(t),v=new Uint8Array(g);for(o=0;o>4,v[l++]=(d&15)<<4|h>>2,v[l++]=(h&3)<<6|m&63;return g},O_=typeof ArrayBuffer=="function",fd=(r,t)=>{if(typeof r!="string")return{type:"message",data:$y(r,t)};const s=r.charAt(0);return s==="b"?{type:"message",data:A_(r.substring(1),t)}:Pa[s]?r.length>1?{type:Pa[s],data:r.substring(1)}:{type:Pa[s]}:Ac},A_=(r,t)=>{if(O_){const s=P_(r);return $y(s,t)}else return{base64:!0,data:r}},$y=(r,t)=>{switch(t){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}},Vy="",j_=(r,t)=>{const s=r.length,o=new Array(s);let l=0;r.forEach((u,d)=>{dd(u,!1,h=>{o[d]=h,++l===s&&t(o.join(Vy))})})},D_=(r,t)=>{const s=r.split(Vy),o=[];for(let l=0;l{const o=s.length;let l;if(o<126)l=new Uint8Array(1),new DataView(l.buffer).setUint8(0,o);else if(o<65536){l=new Uint8Array(3);const u=new DataView(l.buffer);u.setUint8(0,126),u.setUint16(1,o)}else{l=new Uint8Array(9);const u=new DataView(l.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(o))}r.data&&typeof r.data!="string"&&(l[0]|=128),t.enqueue(l),t.enqueue(s)})}})}let nc;function ba(r){return r.reduce((t,s)=>t+s.length,0)}function Sa(r,t){if(r[0].length===t)return r.shift();const s=new Uint8Array(t);let o=0;for(let l=0;lMath.pow(2,21)-1){h.enqueue(Ac);break}l=v*Math.pow(2,32)+g.getUint32(4),o=3}else{if(ba(s)r){h.enqueue(Ac);break}}}})}const Wy=4;function Xe(r){if(r)return F_(r)}function F_(r){for(var t in Xe.prototype)r[t]=Xe.prototype[t];return r}Xe.prototype.on=Xe.prototype.addEventListener=function(r,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(t),this};Xe.prototype.once=function(r,t){function s(){this.off(r,s),t.apply(this,arguments)}return s.fn=t,this.on(r,s),this};Xe.prototype.off=Xe.prototype.removeListener=Xe.prototype.removeAllListeners=Xe.prototype.removeEventListener=function(r,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+r];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var o,l=0;lPromise.resolve().then(t):(t,s)=>s(t,0),Kt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),M_="arraybuffer";function qy(r,...t){return t.reduce((s,o)=>(r.hasOwnProperty(o)&&(s[o]=r[o]),s),{})}const U_=Kt.setTimeout,z_=Kt.clearTimeout;function Ka(r,t){t.useNativeTimers?(r.setTimeoutFn=U_.bind(Kt),r.clearTimeoutFn=z_.bind(Kt)):(r.setTimeoutFn=Kt.setTimeout.bind(Kt),r.clearTimeoutFn=Kt.clearTimeout.bind(Kt))}const B_=1.33;function $_(r){return typeof r=="string"?V_(r):Math.ceil((r.byteLength||r.size)*B_)}function V_(r){let t=0,s=0;for(let o=0,l=r.length;o=57344?s+=3:(o++,s+=4);return s}function Hy(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function W_(r){let t="";for(let s in r)r.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(r[s]));return t}function q_(r){let t={},s=r.split("&");for(let o=0,l=s.length;o{this.readyState="paused",t()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||s()})),this.writable||(o++,this.once("drain",function(){--o||s()}))}else s()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const s=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};D_(t,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,j_(t,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=Hy()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(t,s)}}let Qy=!1;try{Qy=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const K_=Qy;function G_(){}class X_ extends Q_{constructor(t){if(super(t),typeof location<"u"){const s=location.protocol==="https:";let o=location.port;o||(o=s?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||o!==t.port}}doWrite(t,s){const o=this.request({method:"POST",data:t});o.on("success",s),o.on("error",(l,u)=>{this.onError("xhr post error",l,u)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(s,o)=>{this.onError("xhr poll error",s,o)}),this.pollXhr=t}}class xn extends Xe{constructor(t,s,o){super(),this.createRequest=t,Ka(this,o),this._opts=o,this._method=o.method||"GET",this._uri=s,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var t;const s=qy(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(s);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let l in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(l)&&o.setRequestHeader(l,this._opts.extraHeaders[l])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var l;o.readyState===3&&((l=this._opts.cookieJar)===null||l===void 0||l.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(l){this.setTimeoutFn(()=>{this._onError(l)},0);return}typeof document<"u"&&(this._index=xn.requestsCount++,xn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=G_,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete xn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}xn.requestsCount=0;xn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Nm);else if(typeof addEventListener=="function"){const r="onpagehide"in Kt?"pagehide":"unload";addEventListener(r,Nm,!1)}}function Nm(){for(let r in xn.requests)xn.requests.hasOwnProperty(r)&&xn.requests[r].abort()}const Y_=(function(){const r=Ky({xdomain:!1});return r&&r.responseType!==null})();class J_ extends X_{constructor(t){super(t);const s=t&&t.forceBase64;this.supportsBinary=Y_&&!s}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new xn(Ky,this.uri(),t)}}function Ky(r){const t=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||K_))return new XMLHttpRequest}catch{}if(!t)try{return new Kt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Gy=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Z_ extends hd{get name(){return"websocket"}doOpen(){const t=this.uri(),s=this.opts.protocols,o=Gy?{}:qy(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,s,o)}catch(l){return this.emitReserved("error",l)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let s=0;s{try{this.doWrite(o,u)}catch{}l&&Qa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=Hy()),this.supportsBinary||(s.b64=1),this.createUri(t,s)}}const rc=Kt.WebSocket||Kt.MozWebSocket;class ek extends Z_{createSocket(t,s,o){return Gy?new rc(t,s,o):s?new rc(t,s):new rc(t)}doWrite(t,s){this.ws.send(s)}}class tk extends hd{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const s=I_(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=t.readable.pipeThrough(s).getReader(),l=L_();l.readable.pipeTo(t.writable),this._writer=l.writable.getWriter();const u=()=>{o.read().then(({done:h,value:m})=>{h||(this.onPacket(m),u())}).catch(h=>{})};u();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let s=0;s{l&&Qa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const nk={websocket:ek,webtransport:tk,polling:J_},rk=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,sk=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function jc(r){if(r.length>8e3)throw"URI too long";const t=r,s=r.indexOf("["),o=r.indexOf("]");s!=-1&&o!=-1&&(r=r.substring(0,s)+r.substring(s,o).replace(/:/g,";")+r.substring(o,r.length));let l=rk.exec(r||""),u={},d=14;for(;d--;)u[sk[d]]=l[d]||"";return s!=-1&&o!=-1&&(u.source=t,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=ok(u,u.path),u.queryKey=ik(u,u.query),u}function ok(r,t){const s=/\/{2,9}/g,o=t.replace(s,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&o.splice(0,1),t.slice(-1)=="/"&&o.splice(o.length-1,1),o}function ik(r,t){const s={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,l,u){l&&(s[l]=u)}),s}const Dc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Oa=[];Dc&&addEventListener("offline",()=>{Oa.forEach(r=>r())},!1);class vr extends Xe{constructor(t,s){if(super(),this.binaryType=M_,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){const o=jc(t);s.hostname=o.host,s.secure=o.protocol==="https"||o.protocol==="wss",s.port=o.port,o.query&&(s.query=o.query)}else s.host&&(s.hostname=jc(s.host).host);Ka(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(o=>{const l=o.prototype.name;this.transports.push(l),this._transportsByName[l]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=q_(this.opts.query)),Dc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Oa.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const s=Object.assign({},this.opts.query);s.EIO=Wy,s.transport=t,this.id&&(s.sid=this.id);const o=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&vr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",vr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let o=0;o0&&s>this._maxPayload)return this.writeBuffer.slice(0,o);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Qa(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,o){return this._sendPacket("message",t,s,o),this}send(t,s,o){return this._sendPacket("message",t,s,o),this}_sendPacket(t,s,o,l){if(typeof s=="function"&&(l=s,s=void 0),typeof o=="function"&&(l=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const u={type:t,data:s,options:o};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),l&&this.once("flush",l),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},o=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():t()}):this.upgrading?o():t()),this}_onError(t){if(vr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Dc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=Oa.indexOf(this._offlineEventListener);o!==-1&&Oa.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}vr.protocol=Wy;class ak extends vr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{o||(s.send([{type:"ping",data:"probe"}]),s.once("packet",x=>{if(!o)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;vr.priorWebsocketSuccess=s.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(v(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{const k=new Error("probe error");k.transport=s.name,this.emitReserved("upgradeError",k)}}))};function u(){o||(o=!0,v(),s.close(),s=null)}const d=x=>{const k=new Error("probe error: "+x);k.transport=s.name,u(),this.emitReserved("upgradeError",k)};function h(){d("transport closed")}function m(){d("socket closed")}function g(x){s&&x.name!==s.name&&u()}const v=()=>{s.removeListener("open",l),s.removeListener("error",d),s.removeListener("close",h),this.off("close",m),this.off("upgrading",g)};s.once("open",l),s.once("error",d),s.once("close",h),this.once("close",m),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{o||s.open()},200):s.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const s=[];for(let o=0;onk[u]).filter(u=>!!u)),super(o?l:t,l)}};function uk(r,t="",s){let o=r;s=s||typeof location<"u"&&location,r==null&&(r=s.protocol+"//"+s.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=s.protocol+r:r=s.host+r),/^(https?|wss?):\/\//.test(r)||(typeof s<"u"?r=s.protocol+"//"+r:r="https://"+r),o=jc(r)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const u=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+u+":"+o.port+t,o.href=o.protocol+"://"+u+(s&&s.port===o.port?"":":"+o.port),o}const ck=typeof ArrayBuffer=="function",dk=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Xy=Object.prototype.toString,fk=typeof Blob=="function"||typeof Blob<"u"&&Xy.call(Blob)==="[object BlobConstructor]",hk=typeof File=="function"||typeof File<"u"&&Xy.call(File)==="[object FileConstructor]";function pd(r){return ck&&(r instanceof ArrayBuffer||dk(r))||fk&&r instanceof Blob||hk&&r instanceof File}function Aa(r,t){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let s=0,o=r.length;s=0&&r.numthis.opts.maxAttachments)throw new Error("too many attachments");o.attachments=h}if(t.charAt(s+1)==="/"){const u=s+1;for(;++s&&!(t.charAt(s)===","||s===t.length););o.nsp=t.substring(u,s)}else o.nsp="/";const l=t.charAt(s+1);if(l!==""&&Number(l)==l){const u=s+1;for(;++s;){const d=t.charAt(s);if(d==null||Number(d)!=d){--s;break}if(s===t.length)break}o.id=Number(t.substring(u,s+1))}if(t.charAt(++s)){const u=this.tryParse(t.substr(s));if(md.isPayloadValid(o.type,u))o.data=u;else throw new Error("invalid payload")}return o}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,s){switch(t){case Oe.CONNECT:return Pm(s);case Oe.DISCONNECT:return s===void 0;case Oe.CONNECT_ERROR:return typeof s=="string"||Pm(s);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&gk.indexOf(s[0])===-1);case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class vk{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const s=mk(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const xk=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function Pm(r){return Object.prototype.toString.call(r)==="[object Object]"}const wk=Object.freeze(Object.defineProperty({__proto__:null,Decoder:md,Encoder:yk,get PacketType(){return Oe}},Symbol.toStringTag,{value:"Module"}));function ln(r,t,s){return r.on(t,s),function(){r.off(t,s)}}const Ek=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Yy extends Xe{constructor(t,s,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=s,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ln(t,"open",this.onopen.bind(this)),ln(t,"packet",this.onpacket.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...s){var o,l,u;if(Ek.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(s.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;const d={type:Oe.EVENT,data:s};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){const v=this.ids++,x=s.pop();this._registerAckCallback(v,x),d.id=v}const h=(l=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||l===void 0?void 0:l.writable,m=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!h||(m?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(t,s){var o;const l=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(l===void 0){this.acks[t]=s;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let h=0;h{this.io.clearTimeoutFn(u),s.apply(this,h)};d.withError=!0,this.acks[t]=d}emitWithAck(t,...s){return new Promise((o,l)=>{const u=(d,h)=>d?l(d):o(h);u.withError=!0,s.push(u),this.emit(t,...s)})}_addToQueue(t){let s;typeof t[t.length-1]=="function"&&(s=t.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((l,...u)=>(this._queue[0],l!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),s&&s(l)):(this._queue.shift(),s&&s(null,...u)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const s=this._queue[0];s.pending&&!t||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(o=>String(o.id)===t)){const o=this.acks[t];delete this.acks[t],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Oe.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(t);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(t);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const o=new Error(t.data.message);o.data=t.data.data,this.emitReserved("connect_error",o);break}}onevent(t){const s=t.data||[];t.id!=null&&s.push(this.ack(t.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const s=this._anyListeners.slice();for(const o of s)o.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const s=this;let o=!1;return function(...l){o||(o=!0,s.packet({type:Oe.ACK,id:t,data:l}))}}onack(t){const s=this.acks[t.id];typeof s=="function"&&(delete this.acks[t.id],s.withError&&t.data.unshift(null),s.apply(this,t.data))}onconnect(t,s){this.id=t,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const s=this._anyListeners;for(let o=0;o0&&r.jitter<=1?r.jitter:0,this.attempts=0}Hs.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*r);r=(Math.floor(t*10)&1)==0?r-s:r+s}return Math.min(r,this.max)|0};Hs.prototype.reset=function(){this.attempts=0};Hs.prototype.setMin=function(r){this.ms=r};Hs.prototype.setMax=function(r){this.max=r};Hs.prototype.setJitter=function(r){this.jitter=r};class Fc extends Xe{constructor(t,s){var o;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(s=t,t=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,Ka(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((o=s.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new Hs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=t;const l=s.parser||wk;this.encoder=new l.Encoder,this.decoder=new l.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var s;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(s=this.backoff)===null||s===void 0||s.setMin(t),this)}randomizationFactor(t){var s;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(s=this.backoff)===null||s===void 0||s.setJitter(t),this)}reconnectionDelayMax(t){var s;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(s=this.backoff)===null||s===void 0||s.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new lk(this.uri,this.opts);const s=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const l=ln(s,"open",function(){o.onopen(),t&&t()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),t?t(h):this.maybeReconnectOnOpen()},d=ln(s,"error",u);if(this._timeout!==!1){const h=this._timeout,m=this.setTimeoutFn(()=>{l(),u(new Error("timeout")),s.close()},h);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(l),this.subs.push(d),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ln(t,"ping",this.onping.bind(this)),ln(t,"data",this.ondata.bind(this)),ln(t,"error",this.onerror.bind(this)),ln(t,"close",this.onclose.bind(this)),ln(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(s){this.onclose("parse error",s)}}ondecoded(t){Qa(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,s){let o=this.nsps[t];return o?this._autoConnect&&!o.active&&o.connect():(o=new Yy(this,t,s),this.nsps[t]=o),o}_destroy(t){const s=Object.keys(this.nsps);for(const o of s)if(this.nsps[o].active)return;this._close()}_packet(t){const s=this.encoder.encode(t);for(let o=0;ot()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,s){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const s=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(l=>{l?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",l)):t.onreconnect()}))},s);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Io={};function ja(r,t){typeof r=="object"&&(t=r,r=void 0),t=t||{};const s=uk(r,t.path||"/socket.io"),o=s.source,l=s.id,u=s.path,d=Io[l]&&u in Io[l].nsps,h=t.forceNew||t["force new connection"]||t.multiplex===!1||d;let m;return h?m=new Fc(o,t):(Io[l]||(Io[l]=new Fc(o,t)),m=Io[l]),s.query&&!t.query&&(t.query=s.queryKey),m.socket(s.path,t)}Object.assign(ja,{Manager:Fc,Socket:Yy,io:ja,connect:ja});const bk=250;function Om(r,t){var s;const o=(s=r.token)!==null&&s!==void 0?s:Gr(),l={app_id:r.appId,token:o};o||(l.anonymous_id=cd());const u=ja(r.serverUrl,{path:r.mountPath,transports:r.transports,query:l});return u.on("connect",async()=>{var d;return console.log("connect",u.id),(d=t.connect)===null||d===void 0?void 0:d.call(t)}),u.on("update_model",async d=>{var h;return(h=t.update_model)===null||h===void 0?void 0:h.call(t,d)}),u.on("error",async d=>{var h;return(h=t.error)===null||h===void 0?void 0:h.call(t,d)}),u.on("connect_error",async d=>{var h;return console.error("connect_error",d),(h=t.error)===null||h===void 0?void 0:h.call(t,d)}),u}function Sk({config:r}){let t={...r};const s={},o={},l={connect:async()=>{const b=[];Object.keys(s).forEach(D=>{const O=k(D);O.length!==0&&(g(D),O.forEach(({connect:j})=>{const W=async()=>j==null?void 0:j();b.push(W())}))}),await Promise.all(b)},update_model:async b=>{const O=k(b.room).map(j=>{var W;return(W=j.update_model)===null||W===void 0?void 0:W.call(j,b)});await Promise.all(O)},error:async b=>{console.error("error",b);const D=Object.values(s).flat().map(O=>{var j;return(j=O.error)===null||j===void 0?void 0:j.call(O,b)});await Promise.all(D)}};let u=Om(r,l);function d(){h()}function h(){M(),u&&u.disconnect()}function m(b){d(),t={...t,...b},u=Om(t,l)}function g(b){u.emit("join",b)}function v(b){u.emit("leave",b)}async function x(b,D){var O;const j=JSON.stringify(D);return(O=l.update_model)===null||O===void 0?void 0:O.call(l,{room:b,data:j})}function k(b){var D;return(D=s[b])!==null&&D!==void 0?D:[]}function A(b){const D=o[b];D&&(clearTimeout(D),delete o[b])}function M(){Object.keys(o).forEach(b=>{var D,O;clearTimeout(o[b]),delete o[b],((O=(D=s[b])===null||D===void 0?void 0:D.length)!==null&&O!==void 0?O:0)===0&&delete s[b]})}function S(b){A(b),o[b]=setTimeout(()=>{var D,O;delete o[b],!(((O=(D=s[b])===null||D===void 0?void 0:D.length)!==null&&O!==void 0?O:0)>0)&&(v(b),delete s[b])},bk)}return{socket:u,subscribeToRoom:(b,D)=>{s[b]?A(b):(g(b),s[b]=[]),s[b].push(D);let O=!1;return()=>{var j,W;O||(O=!0,s[b]=(W=(j=s[b])===null||j===void 0?void 0:j.filter($=>$!==D))!==null&&W!==void 0?W:[],s[b].length===0&&S(b))}},updateConfig:m,updateModel:x,disconnect:h}}(!globalThis.EventTarget||!globalThis.Event)&&console.error(` PartySocket requires a global 'EventTarget' class to be available! You can polyfill this global by adding this to your code before any partysocket imports: \`\`\` import 'partysocket/event-target-polyfill'; \`\`\` Please file an issue at https://github.com/partykit/partykit if you're still having trouble. `);var Jy=class extends Event{constructor(t,s){super("error",s);De(this,"message");De(this,"error");this.message=t.message,this.error=t}},Zy=class extends Event{constructor(t=1e3,s="",o){super("close",o);De(this,"code");De(this,"reason");De(this,"wasClean",!0);this.code=t,this.reason=s}},sc={Event,ErrorEvent:Jy,CloseEvent:Zy};function _k(r,t){if(!r)throw new Error(t)}function kk(r){return new r.constructor(r.type,r)}function Ck(r){return"data"in r?new MessageEvent(r.type,r):"code"in r||"reason"in r?new Zy(r.code||1999,r.reason||"unknown reason",r):"error"in r?new Jy(r.error,r):new Event(r.type,r)}var Km,Rk=typeof process<"u"&&typeof((Km=process.versions)==null?void 0:Km.node)<"u"&&typeof document>"u",_a=Rk?Ck:kk,Lr={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0},Am=!1,Tk=class Ir extends EventTarget{constructor(s,o,l={}){super();De(this,"_ws");De(this,"_retryCount",-1);De(this,"_uptimeTimeout");De(this,"_connectTimeout");De(this,"_shouldReconnect",!0);De(this,"_connectLock",!1);De(this,"_binaryType","blob");De(this,"_closeCalled",!1);De(this,"_messageQueue",[]);De(this,"_url");De(this,"_protocols");De(this,"_options");De(this,"onclose",null);De(this,"onerror",null);De(this,"onmessage",null);De(this,"onopen",null);De(this,"_handleOpen",s=>{this._debug("open event");const{minUptime:o=Lr.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),o),_k(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(l=>{var u;return(u=this._ws)==null?void 0:u.send(l)}),this._messageQueue=[],this.onopen&&this.onopen(s),this.dispatchEvent(_a(s))});De(this,"_handleMessage",s=>{this._debug("message event"),this.onmessage&&this.onmessage(s),this.dispatchEvent(_a(s))});De(this,"_handleError",s=>{this._debug("error event",s.message),this._disconnect(void 0,s.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(s),this._debug("exec error listeners"),this.dispatchEvent(_a(s)),this._connect()});De(this,"_handleClose",s=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(s),this.dispatchEvent(_a(s))});this._url=s,this._protocols=o,this._options=l,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Ir.CONNECTING}get OPEN(){return Ir.OPEN}get CLOSING(){return Ir.CLOSING}get CLOSED(){return Ir.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(s){this._binaryType=s,this._ws&&(this._ws.binaryType=s)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((o,l)=>(typeof l=="string"?o+=l.length:l instanceof Blob?o+=l.size:o+=l.byteLength,o),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Ir.CLOSED:Ir.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(s=1e3,o){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(s,o)}reconnect(s,o){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(s,o),this._connect())}send(s){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",s),this._ws.send(s);else{const{maxEnqueuedMessages:o=Lr.maxEnqueuedMessages}=this._options;this._messageQueue.length",...s])}_getNextDelay(){const{reconnectionDelayGrowFactor:s=Lr.reconnectionDelayGrowFactor,minReconnectionDelay:o=Lr.minReconnectionDelay,maxReconnectionDelay:l=Lr.maxReconnectionDelay}=this._options;let u=0;return this._retryCount>0&&(u=o*Math.pow(s,this._retryCount-1),u>l&&(u=l)),this._debug("next delay",u),u}_wait(){return new Promise(s=>{setTimeout(s,this._getNextDelay())})}_getNextProtocols(s){if(!s)return Promise.resolve(null);if(typeof s=="string"||Array.isArray(s))return Promise.resolve(s);if(typeof s=="function"){const o=s();if(!o)return Promise.resolve(null);if(typeof o=="string"||Array.isArray(o))return Promise.resolve(o);if(o.then)return o}throw Error("Invalid protocols")}_getNextUrl(s){if(typeof s=="string")return Promise.resolve(s);if(typeof s=="function"){const o=s();if(typeof o=="string")return Promise.resolve(o);if(o.then)return o}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:s=Lr.maxRetries,connectionTimeout:o=Lr.connectionTimeout}=this._options;if(this._retryCount>=s){this._debug("max retries reached",this._retryCount,">=",s);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([l,u])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!Am&&(console.error(`‼️ No WebSocket implementation available. You should define options.WebSocket. For example, if you're using node.js, run \`npm install ws\`, and then in your code: import PartySocket from 'partysocket'; import WS from 'ws'; const partysocket = new PartySocket({ host: "127.0.0.1:1999", room: "test-room", WebSocket: WS }); `),Am=!0);const d=this._options.WebSocket||WebSocket;this._debug("connect",{url:l,protocols:u}),this._ws=u?new d(l,u):new d(l),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),o)}).catch(l=>{this._connectLock=!1,this._handleError(new sc.ErrorEvent(Error(l.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new sc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(s=1e3,o){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(s,o),this._handleClose(new sc.CloseEvent(s,o,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};/*! * Reconnecting WebSocket * by Pedro Ladaria * https://github.com/pladaria/reconnecting-websocket * License MIT */var Nk=r=>r[1]!==null&&r[1]!==void 0;function Pk(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();let r=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){let o=Math.random()*16;return r>0?(o=(r+o)%16|0,r=Math.floor(r/16)):(o=(t+o)%16|0,t=Math.floor(t/16)),(s==="x"?o:o&3|8).toString(16)})}function ev(r,t,s={}){const{host:o,path:l,protocol:u,room:d,party:h,query:m}=r;let g=o.replace(/^(http|https|ws|wss):\/\//,"");if(g.endsWith("/")&&(g=g.slice(0,-1)),l&&l.startsWith("/"))throw new Error("path must not start with a slash");const v=h??"main",x=l?`/${l}`:"",k=u||(g.startsWith("localhost:")||g.startsWith("127.0.0.1:")||g.startsWith("192.168.")||g.startsWith("10.")||g.startsWith("172.")&&g.split(".")[1]>="16"&&g.split(".")[1]<="31"||g.startsWith("[::ffff:7f00:1]:")?t:t+"s"),A=`${k}://${g}/${h?`parties/${h}`:"party"}/${d}${x}`,M=(w={})=>`${A}?${new URLSearchParams([...Object.entries(s),...Object.entries(w).filter(Nk)])}`,S=typeof m=="function"?async()=>M(await m()):M(m);return{host:g,path:x,room:d,name:v,protocol:k,partyUrl:A,urlProvider:S}}var Ok=class extends Tk{constructor(t){const s=jm(t);super(s.urlProvider,s.protocols,s.socketOptions);De(this,"_pk");De(this,"_pkurl");De(this,"name");De(this,"room");De(this,"host");De(this,"path");this.partySocketOptions=t,this.setWSProperties(s)}updateProperties(t){const s=jm({...t,host:t.host??this.host,room:t.room??this.room,path:t.path??this.path});this._url=s.urlProvider,this._protocols=s.protocols,this._options=s.socketOptions,this.setWSProperties(s)}setWSProperties(t){const{_pk:s,_pkurl:o,name:l,room:u,host:d,path:h}=t;this._pk=s,this._pkurl=o,this.name=l,this.room=u,this.host=d,this.path=h}reconnect(t,s){if(!this.room||!this.host)throw new Error("The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.");super.reconnect(t,s)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(t,s){const o=ev(t,"http"),l=typeof o.urlProvider=="string"?o.urlProvider:await o.urlProvider();return(t.fetch??fetch)(l,s)}};function jm(r){const{id:t,host:s,path:o,party:l,room:u,protocol:d,query:h,protocols:m,...g}=r,v=t||Pk(),x=ev(r,"ws",{_pk:v});return{_pk:v,_pkurl:x.partyUrl,name:x.name,room:x.room,host:x.host,path:x.path,protocols:m,socketOptions:g,urlProvider:x.urlProvider}}const Ak=1e3,jk=3e3;class Dk{constructor(t,s,o,l,u){var d;this.onClose=u,this.listeners=new Set,this.heartbeat=null,this.id=(d=l==null?void 0:l.id)!==null&&d!==void 0?d:crypto.randomUUID();const h=new Ok({host:o.host,party:t,room:s,id:this.id,query:()=>{const v=o.getAuthToken();return{app_id:o.appId,handler:t,...v?{token:v}:{},...o.functionsVersion?{fv:o.functionsVersion}:{}}}});this.ws=h;let m=Date.now();const g=()=>{m=Date.now()};h.addEventListener("open",g),h.addEventListener("message",v=>{g();let x;try{x=JSON.parse(v.data)}catch{return}if((x&&typeof x=="object"?x.type:void 0)!=="__pong")for(const A of this.listeners)A(x)}),this.heartbeat=setInterval(()=>{if(Date.now()-m>jk){g(),h.reconnect();return}try{h.send(JSON.stringify({type:"__ping"}))}catch{}},Ak)}subscribe(t){return this.listeners.add(t),{unsubscribe:()=>{this.listeners.delete(t)}}}send(t){this.ws.send(JSON.stringify(t))}close(){this.heartbeat&&(clearInterval(this.heartbeat),this.heartbeat=null),this.listeners.clear(),this.ws.close(),this.onClose()}}function Lk(r,t,s,o){let l=null;return{connect(u){if(l)return l;const d=new Dk(r,t,s,u,()=>{o.delete(d),l===d&&(l=null)});return l=d,o.add(d),d}}}function Ik(r,t){return r&&!r.startsWith("/")?r:t??r}function Fk(r){const t=new Set;return{module:new Proxy({},{get(o,l){if(!(typeof l!="string"||l==="then"))return u=>Lk(l,u,r,t)}}),closeAll:()=>{for(const o of[...t])o.close()}}}function Mk(r){var t,s,o;const{serverUrl:l="https://base44.app",appId:u,token:d,serviceToken:h,requiresAuth:m=!1,appBaseUrl:g,options:v,functionsVersion:x,headers:k}=r,A=typeof g=="string"?g:"",M={serverUrl:l,mountPath:"/ws-user-apps/socket.io/",transports:["websocket"],appId:u,token:d};let S=null;const w=()=>(S||(S=Sk({config:M})),S),b={...k,"X-App-Id":String(u)},D=x?{...b,"Base44-Functions-Version":x}:b,O=Mo({baseURL:`${l}/api`,headers:b,token:d,onError:v==null?void 0:v.onError}),j=Mo({baseURL:`${l}/api`,headers:D,token:d,interceptResponses:!1,onError:v==null?void 0:v.onError}),W={...b,...d?{"on-behalf-of":`Bearer ${d}`}:{}},$=Mo({baseURL:`${l}/api`,headers:W,token:h,onError:v==null?void 0:v.onError}),G=Mo({baseURL:`${l}/api`,headers:D,token:h,interceptResponses:!1}),B=S_(O,j,u,{appBaseUrl:A});if(typeof window<"u"){const we=d||Gr();we&&B.setToken(we)}const ie=Fk({appId:u,host:Ik(l,typeof window<"u"?(t=window.location)===null||t===void 0?void 0:t.origin:void 0),functionsVersion:x,getAuthToken:()=>d||Gr()}),ue={entities:wm({axios:O,appId:u,getSocket:w}),integrations:Em(O,u),connectors:C_(O,u),auth:B,functions:bm(j,u,{getAuthHeaders:()=>{const we={},J=d||Gr();return J&&(we.Authorization=`Bearer ${J}`),we},baseURL:(s=j.defaults)===null||s===void 0?void 0:s.baseURL}),agents:Sm({axios:O,getSocket:w,appId:u,serverUrl:l,token:d}),aiGateway:_m({serverUrl:l,token:d,appId:u}),appLogs:km(O,u),users:T_(O,u),analytics:u_({axiosClient:O,serverUrl:l,appId:u,userAuthModule:B}),actors:ie.module,cleanup:()=>{ue.analytics.cleanup(),ie.closeAll(),S&&S.disconnect()}},Ee={entities:wm({axios:$,appId:u,getSocket:w}),integrations:Em($,u),sso:__($,u),connectors:k_($,u),functions:bm(G,u,{getAuthHeaders:()=>{const we={};return h&&(we.Authorization=`Bearer ${h}`),we},baseURL:(o=G.defaults)===null||o===void 0?void 0:o.baseURL}),agents:Sm({axios:$,getSocket:w,appId:u,serverUrl:l,token:d}),aiGateway:_m({serverUrl:l,token:h,appId:u}),appLogs:km($,u),cleanup:()=>{S&&S.disconnect()}};return m&&typeof window<"u"&&setTimeout(async()=>{try{await ue.auth.isAuthenticated()||ue.auth.redirectToLogin(window.location.href)}catch(we){console.error("Authentication check failed:",we),ue.auth.redirectToLogin(window.location.href)}},0),{...ue,setToken(we){ue.auth.setToken(we),S&&S.updateConfig({token:we}),M.token=we},getConfig(){return{serverUrl:l,appId:u,requiresAuth:m}},get asServiceRole(){if(!h)throw new Error("Service token is required to use asServiceRole. Please provide a serviceToken when creating the client.");return Ee}}}const tv=typeof window>"u",Uk=tv?{localStorage:new Map}:window,Vo=Uk.localStorage,zk=r=>r.replace(/([A-Z])/g,"_$1").toLowerCase(),Rs=(r,{defaultValue:t=void 0,removeFromUrl:s=!1}={})=>{if(tv)return t;const o=`base44_${zk(r)}`,l=new URLSearchParams(window.location.search),u=l.get(r);if(s){l.delete(r);const h=`${window.location.pathname}${l.toString()?`?${l.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,h)}if(u)return Vo.setItem(o,u),u;if(t)return Vo.setItem(o,t),t;const d=Vo.getItem(o);return d||null},Bk=()=>(Rs("clear_access_token")==="true"&&(Vo.removeItem("base44_access_token"),Vo.removeItem("token")),{appId:Rs("app_id",{defaultValue:"6a7b579c2b8d1ccd3501bcbf"}),token:Rs("access_token",{removeFromUrl:!0}),fromUrl:Rs("from_url",{defaultValue:window.location.href}),functionsVersion:Rs("functions_version",{defaultValue:"prod"}),appBaseUrl:Rs("app_base_url",{defaultValue:void 0})}),zo={...Bk()},{appId:$k,token:Vk,functionsVersion:Wk,appBaseUrl:qk}=zo,Bo=Mk({appId:$k,token:Vk,functionsVersion:Wk,serverUrl:"",requiresAuth:!1,appBaseUrl:qk});function Hk({}){var l;const t=nd().pathname.substring(1),{data:s,isFetched:o}=aE({queryKey:["user"],queryFn:async()=>{try{return{user:await Bo.auth.me(),isAuthenticated:!0}}catch{return{user:null,isAuthenticated:!1}}}});return p.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 bg-slate-50",children:p.jsx("div",{className:"max-w-md w-full",children:p.jsxs("div",{className:"text-center space-y-6",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx("h1",{className:"text-7xl font-light text-slate-300",children:"404"}),p.jsx("div",{className:"h-0.5 w-16 bg-slate-200 mx-auto"})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsx("h2",{className:"text-2xl font-medium text-slate-800",children:"Page Not Found"}),p.jsxs("p",{className:"text-slate-600 leading-relaxed",children:["The page ",p.jsxs("span",{className:"font-medium text-slate-700",children:['"',t,'"']})," could not be found in this application."]})]}),o&&s.isAuthenticated&&((l=s.user)==null?void 0:l.role)==="admin"&&p.jsx("div",{className:"mt-8 p-4 bg-slate-100 rounded-lg border border-slate-200",children:p.jsxs("div",{className:"flex items-start space-x-3",children:[p.jsx("div",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-orange-100 flex items-center justify-center mt-0.5",children:p.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-400"})}),p.jsxs("div",{className:"text-left space-y-1",children:[p.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Admin Note"}),p.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:"This could mean that the AI hasn't implemented this page yet. Ask it to implement it in the chat."})]})]})}),p.jsx("div",{className:"pt-6",children:p.jsxs("button",{onClick:()=>window.location.href="/",className:"inline-flex items-center px-4 py-2 text-sm font-medium text-slate-700 bg-white border border-slate-200 rounded-lg hover:bg-slate-50 hover:border-slate-300 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500",children:[p.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),"Go Home"]})})]})})})}const nv=C.createContext(),Qk=({children:r})=>{const[t,s]=C.useState(null),[o,l]=C.useState(!1),[u,d]=C.useState(!0),[h,m]=C.useState(!0),[g,v]=C.useState(null),[x,k]=C.useState(!1),[A,M]=C.useState(null);C.useEffect(()=>{S()},[]);const S=async()=>{var O,j;try{m(!0),v(null);const W=Mo({baseURL:"/api/apps/public",headers:{"X-App-Id":zo.appId},token:zo.token,interceptResponses:!0});try{const $=await W.get(`/prod/public-settings/by-id/${zo.appId}`);M($),zo.token?await w():(d(!1),l(!1),k(!0)),m(!1)}catch($){if(console.error("App state check failed:",$),$.status===403&&((j=(O=$.data)==null?void 0:O.extra_data)!=null&&j.reason)){const G=$.data.extra_data.reason;v(G==="auth_required"?{type:"auth_required",message:"Authentication required"}:G==="user_not_registered"?{type:"user_not_registered",message:"User not registered for this app"}:{type:G,message:$.message})}else v({type:"unknown",message:$.message||"Failed to load app"});m(!1),d(!1)}}catch(W){console.error("Unexpected error:",W),v({type:"unknown",message:W.message||"An unexpected error occurred"}),m(!1),d(!1)}},w=async()=>{try{d(!0);const O=await Bo.auth.me();s(O),l(!0),d(!1),k(!0)}catch(O){console.error("User auth check failed:",O),d(!1),l(!1),k(!0),(O.status===401||O.status===403)&&v({type:"auth_required",message:"Authentication required"})}},b=(O=!0)=>{s(null),l(!1),O?Bo.auth.logout(window.location.href):Bo.auth.logout()},D=()=>{Bo.auth.redirectToLogin(window.location.href)};return p.jsx(nv.Provider,{value:{user:t,isAuthenticated:o,isLoadingAuth:u,isLoadingPublicSettings:h,authError:g,appPublicSettings:A,authChecked:x,logout:b,navigateToLogin:D,checkUserAuth:w,checkAppState:S},children:r})},Kk=()=>{const r=C.useContext(nv);if(!r)throw new Error("useAuth must be used within an AuthProvider");return r},Gk=()=>p.jsx("div",{className:"flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-white to-slate-50",children:p.jsx("div",{className:"max-w-md w-full p-8 bg-white rounded-lg shadow-lg border border-slate-100",children:p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-orange-100",children:p.jsx("svg",{className:"w-8 h-8 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),p.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-4",children:"Access Restricted"}),p.jsx("p",{className:"text-slate-600 mb-8",children:"You are not registered to use this application. Please contact the app administrator to request access."}),p.jsxs("div",{className:"p-4 bg-slate-50 rounded-md text-sm text-slate-600",children:[p.jsx("p",{children:"If you believe this is an error, you can:"}),p.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[p.jsx("li",{children:"Verify you are logged in with the correct account"}),p.jsx("li",{children:"Contact the app administrator for access"}),p.jsx("li",{children:"Try logging out and back in again"})]})]})]})})}),Xk=r=>{const t=r.slice(1);try{return decodeURIComponent(t)}catch{return t}};function Yk(){const{pathname:r,hash:t}=nd(),s=jE();return C.useEffect(()=>{if(s!=="POP"){if(t){const o=Xk(t),l=window.setTimeout(()=>{var u;(u=document.getElementById(o))==null||u.scrollIntoView({behavior:"smooth"})},50);return()=>window.clearTimeout(l)}window.scrollTo({top:0,left:0,behavior:"instant"})}},[r,t,s]),null}const Dm=["About","Our Business","Our Portfolio","Sustainability","Corporate Information","News / Insights"];function Jk(){const[r,t]=C.useState(!1);return p.jsx("header",{className:"no-print sticky top-0 z-40 bg-white border-b border-[#D9D5D2]",children:p.jsxs("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8",children:[p.jsxs("div",{className:"flex h-[88px] items-center justify-between",children:[p.jsxs("a",{href:"/",className:"flex items-center gap-3",children:[p.jsx("span",{className:"h-8 w-8 border border-[#8D0034] rotate-45 inline-block","aria-hidden":!0}),p.jsx("span",{className:"font-display text-[22px] font-semibold tracking-[0.18em] text-[#171717]",children:"ALRAZAH"})]}),p.jsx("nav",{className:"hidden lg:flex items-center gap-8",children:Dm.map(s=>p.jsx("a",{href:"#",className:"text-[13.5px] font-medium text-[#565656] hover:text-[#8D0034] transition-colors duration-200",children:s},s))}),p.jsxs("div",{className:"flex items-center gap-5",children:[p.jsx("button",{"aria-label":"Search",className:"text-[#565656] hover:text-[#8D0034] transition-colors",children:p.jsx(Rw,{size:18,strokeWidth:1.5})}),p.jsxs("button",{"aria-label":"Language",className:"flex items-center gap-1.5 text-[13px] font-medium text-[#565656] hover:text-[#8D0034] transition-colors",children:[p.jsx(Sw,{size:16,strokeWidth:1.5})," ",p.jsx("span",{className:"hidden sm:inline",children:"EN"})]}),p.jsx("a",{href:"#",className:"hidden md:inline-flex items-center h-9 px-4 border border-[#171717] text-[13px] font-medium text-[#171717] hover:bg-[#171717] hover:text-white transition-colors",children:"Contact"}),p.jsx("button",{className:"lg:hidden text-[#171717]",onClick:()=>t(!r),"aria-label":"Menu",children:r?p.jsx(Kc,{size:22,strokeWidth:1.5}):p.jsx(kw,{size:22,strokeWidth:1.5})})]})]}),r&&p.jsx("div",{className:"lg:hidden pb-6 border-t border-[#D9D5D2] pt-4 flex flex-col gap-3",children:Dm.map(s=>p.jsx("a",{href:"#",className:"text-[14px] font-medium text-[#272727] py-1",children:s},s))})]})})}const Zk=[{label:"Privacy Policy",href:"#"},{label:"Terms of Use",href:"#"},{label:"Cookie Policy",href:"/legal/cookie-policy/",active:!0},{label:"Disclosures",href:"#"}];function eC(){return p.jsx("div",{className:"no-print bg-[#F4F2EF] border-b border-[#D9D5D2]",children:p.jsx("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8",children:p.jsxs("div",{className:"flex h-[50px] items-center justify-between gap-6",children:[p.jsx("span",{className:"hidden md:block text-[11px] font-mono font-medium tracking-[0.16em] text-[#565656] uppercase",children:"Legal & Corporate Information"}),p.jsx("nav",{className:"flex items-center gap-6 overflow-x-auto no-scrollbar",children:Zk.map(r=>p.jsxs("a",{href:r.href,className:`relative whitespace-nowrap text-[13px] font-medium pb-[18px] -mb-[18px] transition-colors duration-200 ${r.active?"text-[#8D0034]":"text-[#565656] hover:text-[#171717]"}`,children:[r.label,r.active&&p.jsx("span",{className:"absolute left-0 right-0 -bottom-px h-[3px] bg-[#8D0034]"})]},r.label))})]})})})}const tC=[{title:"Alrazah",links:["About","Leadership","Governance","Sustainability"]},{title:"Our Business",links:["Real Estate","Asset Management","Logistics & Industrial","Project Management"]},{title:"Portfolio",links:["Portfolio Overview","Projects","Completed","Under Development","Pipeline"]},{title:"Corporate",links:["News","Reports","Contact","Careers"]},{title:"Legal",links:["Privacy Policy","Terms of Use","Cookie Policy","Disclosures"]}];function nC(){return p.jsx("footer",{className:"bg-[#4F001D] text-white",children:p.jsxs("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8 py-16",children:[p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-10",children:tC.map(r=>p.jsxs("div",{children:[p.jsx("h4",{className:"text-[11px] font-mono font-medium tracking-[0.18em] uppercase text-white/50 mb-5",children:r.title}),p.jsx("ul",{className:"space-y-3",children:r.links.map(t=>p.jsx("li",{children:p.jsx("a",{href:"#",className:"text-[13.5px] text-white/80 hover:text-white transition-colors duration-200",children:t})},t))})]},r.title))}),p.jsxs("div",{className:"mt-14 pt-8 border-t border-white/15 flex flex-col md:flex-row md:items-end md:justify-between gap-8",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[p.jsx("span",{className:"h-7 w-7 border border-white/40 rotate-45 inline-block","aria-hidden":!0}),p.jsx("span",{className:"font-display text-[18px] font-semibold tracking-[0.18em]",children:"ALRAZAH"})]}),p.jsxs("p",{className:"text-[13px] text-white/70 leading-relaxed",children:["Alrazah Holding Company",p.jsx("br",{}),"[Registered Address], Doha, State of Qatar",p.jsx("br",{}),"[Phone] · [Email]"]})]}),p.jsxs("div",{className:"flex items-center gap-6",children:[p.jsx("button",{className:"text-[13px] font-medium text-white/70 hover:text-white transition-colors",children:"العربية"}),p.jsx("span",{className:"text-[11px] font-mono tracking-[0.16em] uppercase text-white/40",children:"© 2026 Alrazah Holding Company"})]})]})]})})}function rC(){return p.jsx("div",{className:"no-print bg-[#FAF9F7]",children:p.jsx("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8 pt-8 pb-2",children:p.jsxs("nav",{className:"flex items-center gap-2 text-[12.5px]","aria-label":"Breadcrumb",children:[p.jsx("a",{href:"/",className:"text-[#565656] hover:text-[#8D0034] transition-colors",children:"Home"}),p.jsx("span",{className:"text-[#D9D5D2]",children:"/"}),p.jsx("a",{href:"#",className:"text-[#565656] hover:text-[#8D0034] transition-colors",children:"Legal"}),p.jsx("span",{className:"text-[#D9D5D2]",children:"/"}),p.jsx("span",{className:"text-[#171717] font-medium",children:"Cookie Policy"})]})})})}function sC(){return p.jsxs("section",{className:"relative bg-[#4F001D] text-white overflow-hidden",children:[p.jsx("div",{className:"absolute inset-0 alrazah-grid-pattern","aria-hidden":!0}),p.jsx("div",{className:"absolute inset-x-0 bottom-0 h-px bg-white/10","aria-hidden":!0}),p.jsx("div",{className:"relative mx-auto max-w-[1240px] px-6 lg:px-8 py-16 lg:py-20",children:p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-12 items-start",children:[p.jsxs("div",{className:"lg:col-span-8",children:[p.jsx("span",{className:"text-[11px] font-mono font-medium tracking-[0.2em] uppercase text-white/55",children:"Legal & Digital Privacy"}),p.jsx("h1",{className:"mt-5 font-display text-[44px] sm:text-[52px] lg:text-[58px] leading-[1.08] font-semibold tracking-[-0.01em]",children:"Cookie Policy"}),p.jsx("p",{className:"mt-6 max-w-[620px] text-[17px] lg:text-[18px] leading-[1.8] text-white/75 font-body",children:"This Cookie Policy explains how Alrazah uses cookies and similar technologies to support website functionality, understand digital usage and maintain a reliable and secure online experience."}),p.jsxs("div",{className:"mt-8 flex items-center gap-5 text-[12.5px] text-white/55",children:[p.jsx("span",{className:"font-mono tracking-[0.14em] uppercase",children:"Effective · 11 August 2026"}),p.jsx("span",{className:"h-3 w-px bg-white/20"}),p.jsxs("a",{href:"#content",className:"inline-flex items-center gap-1.5 text-white/80 hover:text-white transition-colors",children:["Read document ",p.jsx(un,{size:14,strokeWidth:1.5})]})]})]}),p.jsx("div",{className:"lg:col-span-4",children:p.jsxs("div",{className:"border border-white/20 bg-white/[0.03] backdrop-blur-sm",children:[p.jsxs("div",{className:"px-5 py-4 border-b border-white/15",children:[p.jsx("span",{className:"text-[10.5px] font-mono font-medium tracking-[0.18em] uppercase text-white/45",children:"Document"}),p.jsx("p",{className:"mt-1 text-[15px] font-medium text-white",children:"Cookie Policy"})]}),[["Status","Current"],["Last Updated","11 August 2026"],["Applies To","Alrazah Digital Platforms"]].map(([r,t])=>p.jsxs("div",{className:"px-5 py-4 border-b border-white/15 last:border-0",children:[p.jsx("span",{className:"text-[10.5px] font-mono font-medium tracking-[0.18em] uppercase text-white/45",children:r}),p.jsx("p",{className:"mt-1 text-[14px] text-white/90",children:t})]},r))]})})]})})]})}const oC=[["Document Type","Digital Privacy Policy"],["Website","Alrazah Corporate Website"],["Version","2.4"],["Language","English | العربية"]];function iC(){return p.jsx("section",{className:"no-print bg-[#F4F2EF] border-y border-[#D9D5D2]",children:p.jsx("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8",children:p.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4",children:oC.map(([r,t],s)=>p.jsxs("div",{className:`px-5 py-7 ${s!==0?"lg:border-l border-[#D9D5D2]":""} ${s===2?"border-l border-t lg:border-t-0 border-[#D9D5D2]":""} ${s===3?"border-t lg:border-t-0 border-[#D9D5D2]":""}`,children:[p.jsx("span",{className:"text-[10.5px] font-mono font-medium tracking-[0.18em] uppercase text-[#565656]",children:r}),p.jsx("p",{className:"mt-1.5 text-[14.5px] font-medium text-[#171717]",children:t})]},r))})})})}function aC({onManage:r,consentStatus:t}){return p.jsx("section",{className:"no-print bg-[#F5E8ED] border-b border-[#E3D0D8]",children:p.jsx("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8 py-7",children:p.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-5",children:[p.jsxs("div",{className:"flex items-start gap-4",children:[p.jsx("span",{className:"hidden sm:flex h-10 w-10 items-center justify-center border border-[#8D0034]/30 text-[#8D0034] shrink-0",children:p.jsx(Nw,{size:18,strokeWidth:1.5})}),p.jsxs("div",{children:[p.jsx("h2",{className:"text-[11px] font-mono font-medium tracking-[0.18em] uppercase text-[#8D0034]",children:"Cookie Preferences"}),p.jsx("p",{className:"mt-1.5 text-[14.5px] text-[#272727] max-w-[560px] leading-relaxed",children:"Manage your preferences for non-essential cookies and similar technologies used across the Alrazah website."})]})]}),p.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[t&&p.jsxs("div",{className:"hidden lg:block text-right",children:[p.jsx("span",{className:"text-[10px] font-mono tracking-[0.16em] uppercase text-[#565656]",children:"Current Preference"}),p.jsx("p",{className:"text-[13px] font-medium text-[#171717]",children:t})]}),p.jsxs("button",{onClick:r,className:"inline-flex items-center gap-2 h-11 px-6 bg-[#8D0034] text-white text-[13.5px] font-medium hover:bg-[#650025] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[#8D0034] transition-colors duration-200",children:["Manage Preferences ",p.jsx(un,{size:15,strokeWidth:1.75})]})]})]})})})}const oc=[{id:"overview",num:"01",label:"Overview"},{id:"what-are-cookies",num:"02",label:"What Are Cookies"},{id:"how-we-use",num:"03",label:"How We Use Cookies"},{id:"categories",num:"04",label:"Cookie Categories"},{id:"third-parties",num:"05",label:"Third-Party Technologies"},{id:"retention",num:"06",label:"Cookie Retention"},{id:"managing",num:"07",label:"Managing Preferences"},{id:"browser",num:"08",label:"Browser Controls"},{id:"updates",num:"09",label:"Policy Updates"},{id:"contact",num:"10",label:"Contact"}];function lC(){const[r,t]=C.useState("overview"),[s,o]=C.useState(!1);return C.useEffect(()=>{const l=new IntersectionObserver(u=>{u.forEach(d=>{d.isIntersecting&&t(d.target.id)})},{rootMargin:"-30% 0px -60% 0px",threshold:0});return oc.forEach(u=>{const d=document.getElementById(u.id);d&&l.observe(d)}),()=>l.disconnect()},[]),p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"lg:hidden no-print mb-6 border border-[#D9D5D2] bg-white",children:[p.jsxs("button",{onClick:()=>o(!s),className:"w-full flex items-center justify-between px-5 py-4 text-[12px] font-mono font-medium tracking-[0.16em] uppercase text-[#171717]",children:["On This Page",p.jsx(Rg,{size:16,strokeWidth:1.5,className:`transition-transform ${s?"rotate-180":""}`})]}),s&&p.jsx("nav",{className:"px-5 pb-4 flex flex-col gap-1 border-t border-[#D9D5D2]",children:oc.map(l=>p.jsxs("a",{href:`#${l.id}`,onClick:()=>o(!1),className:`py-2 text-[14px] ${r===l.id?"text-[#8D0034] font-medium":"text-[#565656]"}`,children:[p.jsx("span",{className:"font-mono text-[11px] mr-2 text-[#9a9a9a]",children:l.num}),l.label]},l.id))})]}),p.jsx("aside",{className:"hidden lg:block no-print",children:p.jsxs("div",{className:"sticky top-[150px]",children:[p.jsx("h3",{className:"text-[11px] font-mono font-medium tracking-[0.18em] uppercase text-[#565656] mb-5 pb-3 border-b border-[#D9D5D2]",children:"On This Page"}),p.jsx("nav",{className:"flex flex-col",children:oc.map(l=>p.jsxs("a",{href:`#${l.id}`,className:`relative pl-4 py-2.5 text-[13.5px] transition-colors duration-200 ${r===l.id?"text-[#8D0034] font-medium":"text-[#565656] hover:text-[#171717]"}`,children:[r===l.id&&p.jsx("span",{className:"absolute left-0 top-2 bottom-2 w-[3px] bg-[#8D0034]"}),p.jsx("span",{className:"font-mono text-[11px] mr-2 text-[#9a9a9a]",children:l.num}),l.label]},l.id))})]})})]})}function wn({num:r,children:t,id:s}){return p.jsxs("div",{id:s,className:"scroll-mt-[150px]",children:[p.jsx("span",{className:"text-[11px] font-mono font-medium tracking-[0.2em] text-[#8D0034]",children:r}),p.jsx("h2",{className:"mt-2 font-display text-[28px] lg:text-[34px] leading-[1.2] font-medium text-[#171717] tracking-[-0.01em]",children:t})]})}const uC=[["Website operation","Supporting essential website functions."],["Security","Supporting security, fraud prevention and system integrity."],["Preferences","Remembering selected preferences."],["Performance","Understanding website performance."],["Analytics","Understanding aggregated website usage."],["Improvement","Using information to improve digital services."]],Lm=[["Essential","Core website operation","Always active"],["Preferences","Remember user selections","Where applicable"],["Analytics","Understand website usage","Consent-based where required"],["Performance","Improve website reliability","Consent-based where required"]];function cC(){return p.jsxs("div",{className:"space-y-16",children:[p.jsxs("section",{children:[p.jsx(wn,{num:"01",id:"overview",children:"About this Cookie Policy"}),p.jsx("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:"This Cookie Policy explains how cookies and similar technologies may be used when you access Alrazah's website. It should be read together with the Alrazah Privacy Policy and other applicable legal notices."}),p.jsxs("a",{href:"#",className:"mt-4 inline-flex items-center gap-1.5 text-[14px] font-medium text-[#8D0034] hover:text-[#650025] transition-colors",children:["Read our Privacy Policy ",p.jsx(un,{size:14,strokeWidth:1.75})]})]}),p.jsxs("section",{children:[p.jsx(wn,{num:"02",id:"what-are-cookies",children:"What are cookies?"}),p.jsxs("div",{className:"mt-5 space-y-5 max-w-[700px]",children:[p.jsxs("div",{children:[p.jsx("h3",{className:"text-[15px] font-mono font-medium tracking-[0.08em] uppercase text-[#565656] mb-2",children:"Definition"}),p.jsx("p",{className:"text-[17px] leading-[1.85] text-[#272727]",children:"Cookies are small files or identifiers stored or accessed through a user's device or browser when visiting a website. They allow the website to recognise the device and remember information about the visit."})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-[15px] font-mono font-medium tracking-[0.08em] uppercase text-[#565656] mb-2",children:"Similar technologies"}),p.jsx("p",{className:"text-[17px] leading-[1.85] text-[#272727]",children:"This policy may also cover similar technologies, including pixels, tags, local storage and other tracking technologies that perform a comparable function."})]})]})]}),p.jsxs("section",{children:[p.jsx(wn,{num:"03",id:"how-we-use",children:"How Alrazah uses cookies"}),p.jsx("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:"Where used, cookies and similar technologies may support the following purposes:"}),p.jsx("ul",{className:"mt-6 grid sm:grid-cols-2 gap-x-8 gap-y-4 max-w-[760px]",children:uC.map(([r,t])=>p.jsxs("li",{className:"flex gap-3",children:[p.jsx("span",{className:"mt-2 h-1.5 w-1.5 bg-[#8D0034] shrink-0"}),p.jsxs("div",{children:[p.jsx("p",{className:"text-[15px] font-medium text-[#171717]",children:r}),p.jsx("p",{className:"text-[14.5px] text-[#565656] leading-relaxed",children:t})]})]},r))}),p.jsx("div",{className:"mt-10 border border-[#D9D5D2] overflow-x-auto",children:p.jsxs("table",{className:"w-full text-left",children:[p.jsx("thead",{children:p.jsx("tr",{className:"bg-[#F4F2EF]",children:["Purpose","Function","Consent"].map(r=>p.jsx("th",{className:"px-5 py-3.5 text-[11px] font-mono font-medium tracking-[0.14em] uppercase text-[#565656] border-b border-[#D9D5D2]",children:r},r))})}),p.jsx("tbody",{children:Lm.map((r,t)=>p.jsxs("tr",{className:t!==Lm.length-1?"border-b border-[#D9D5D2]":"",children:[p.jsx("td",{className:"px-5 py-4 text-[14px] font-medium text-[#171717]",children:r[0]}),p.jsx("td",{className:"px-5 py-4 text-[14px] text-[#272727]",children:r[1]}),p.jsx("td",{className:"px-5 py-4 text-[14px] text-[#565656]",children:r[2]})]},r[0]))})]})})]})]})}const dC=[{num:"01",name:"Strictly Necessary Cookies",copy:"These cookies support essential website functions and cannot generally be disabled through the website’s preference controls.",meta:[["Status","Always active"],["Purpose","Website operation and security"]],locked:!0},{num:"02",name:"Preference Cookies",copy:"These technologies may allow the website to remember choices or settings made during a user’s visit.",meta:[["Status","Optional"],["Control","Cookie Preferences"]]},{num:"03",name:"Analytics Cookies",copy:"Where used and permitted, analytics technologies may help Alrazah understand how visitors interact with the website and identify opportunities to improve performance and usability.",meta:[["Status","Consent-based where applicable"],["Purpose","Aggregated website analytics"]]},{num:"04",name:"Functional & Performance Technologies",copy:"These technologies support enhanced functionality and help maintain the reliability and performance of the website where they are implemented.",meta:[["Status","Consent-based where applicable"],["Purpose","Functionality and performance"]]}];function fC(){return p.jsxs("section",{children:[p.jsx(wn,{num:"04",id:"categories",children:"Cookie Categories"}),p.jsx("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:"Cookies used on the Alrazah website may be grouped according to their purpose and function."}),p.jsx("div",{className:"mt-8 grid md:grid-cols-2 gap-5",children:dC.map(r=>p.jsxs("div",{className:"border border-[#D9D5D2] bg-white hover:border-[#8D0034]/40 transition-colors duration-200",children:[p.jsxs("div",{className:"px-6 py-5 border-b border-[#D9D5D2] flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("span",{className:"font-mono text-[12px] font-medium tracking-[0.14em] text-[#8D0034]",children:r.num}),p.jsx("h3",{className:"text-[17px] font-medium text-[#171717]",children:r.name})]}),r.locked&&p.jsx("span",{className:"text-[10px] font-mono tracking-[0.14em] uppercase text-[#8D0034] border border-[#8D0034]/30 px-2 py-1",children:"Locked"})]}),p.jsx("p",{className:"px-6 py-5 text-[14.5px] leading-[1.75] text-[#272727]",children:r.copy}),p.jsx("dl",{className:"px-6 pb-5 grid grid-cols-2 gap-4 border-t border-[#D9D5D2] pt-4",children:r.meta.map(([t,s])=>p.jsxs("div",{children:[p.jsx("dt",{className:"text-[10px] font-mono font-medium tracking-[0.16em] uppercase text-[#565656]",children:t}),p.jsx("dd",{className:"mt-1 text-[13.5px] font-medium text-[#171717]",children:s})]},t))})]},r.num))})]})}const Im=[{name:"alrazah_session",provider:"Alrazah",purpose:"Website functionality & authentication",category:"Necessary",duration:"Session",type:"First-party"},{name:"alrazah_csrf",provider:"Alrazah",purpose:"Security & form protection",category:"Necessary",duration:"2 hours",type:"First-party"},{name:"alrazah_prefs",provider:"Alrazah",purpose:"Remember user preferences",category:"Preferences",duration:"180 days",type:"First-party"},{name:"_ga",provider:"Google Analytics",purpose:"Aggregated website analytics",category:"Analytics",duration:"24 months",type:"Third-party"},{name:"_gid",provider:"Google Analytics",purpose:"Distinguish users",category:"Analytics",duration:"24 hours",type:"Third-party"}],hC=["Name","Provider","Purpose","Category","Duration","Type"];function pC(){const[r,t]=C.useState(null);return p.jsxs("div",{className:"mt-10",children:[p.jsx("h3",{className:"text-[12px] font-mono font-medium tracking-[0.18em] uppercase text-[#565656] mb-4",children:"Cookie Inventory"}),p.jsx("div",{className:"hidden md:block border border-[#D9D5D2] overflow-x-auto",children:p.jsxs("table",{className:"w-full text-left",children:[p.jsx("thead",{children:p.jsx("tr",{className:"bg-[#F4F2EF]",children:hC.map(s=>p.jsx("th",{className:"px-4 py-3.5 text-[11px] font-mono font-medium tracking-[0.14em] uppercase text-[#565656] border-b border-[#D9D5D2]",children:s},s))})}),p.jsx("tbody",{children:Im.map((s,o)=>p.jsxs("tr",{className:`border-b border-[#D9D5D2] last:border-0 hover:bg-[#F5E8ED] transition-colors duration-150 ${o%2?"bg-[#FAF9F7]":"bg-white"}`,children:[p.jsx("td",{className:"px-4 py-4 text-[13px] font-mono text-[#171717]",children:s.name}),p.jsx("td",{className:"px-4 py-4 text-[13.5px] text-[#272727]",children:s.provider}),p.jsx("td",{className:"px-4 py-4 text-[13.5px] text-[#272727]",children:s.purpose}),p.jsx("td",{className:"px-4 py-4 text-[13px] text-[#565656]",children:s.category}),p.jsx("td",{className:"px-4 py-4 text-[13px] text-[#565656]",children:s.duration}),p.jsx("td",{className:"px-4 py-4 text-[13px] text-[#565656]",children:s.type})]},s.name))})]})}),p.jsx("div",{className:"md:hidden flex flex-col gap-3",children:Im.map((s,o)=>p.jsxs("div",{className:"border border-[#D9D5D2] bg-white",children:[p.jsxs("button",{onClick:()=>t(r===o?null:o),className:"w-full flex items-center justify-between px-5 py-4 text-left",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-[13px] font-mono text-[#171717]",children:s.name}),p.jsxs("p",{className:"mt-0.5 text-[12px] text-[#565656]",children:[s.category," · ",s.type]})]}),p.jsx(Rg,{size:16,strokeWidth:1.5,className:`shrink-0 transition-transform ${r===o?"rotate-180":""}`})]}),r===o&&p.jsx("dl",{className:"px-5 pb-5 pt-1 border-t border-[#D9D5D2] grid grid-cols-2 gap-x-4 gap-y-3",children:[["Provider",s.provider],["Purpose",s.purpose],["Duration",s.duration],["Type",s.type]].map(([l,u])=>p.jsxs("div",{children:[p.jsx("dt",{className:"text-[10px] font-mono tracking-[0.14em] uppercase text-[#565656]",children:l}),p.jsx("dd",{className:"mt-0.5 text-[13px] text-[#171717]",children:u})]},l))})]},s.name))}),p.jsxs("p",{className:"mt-4 text-[12.5px] text-[#565656] flex items-center gap-1.5",children:[p.jsx(Qc,{size:13,strokeWidth:1.5})," The cookie inventory is maintained by Alrazah","’","s privacy and technical teams."]})]})}const mC=[{provider:"Google Analytics",service:"Web analytics",purpose:"Aggregated usage statistics",category:"Analytics"},{provider:"Content Delivery Network",service:"Edge delivery",purpose:"Performance and reliability",category:"Performance"}];function gC(){return p.jsxs("section",{children:[p.jsx(wn,{num:"05",id:"third-parties",children:"Third-party technologies"}),p.jsxs("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:["Certain website functions may rely on services provided by third parties. Where such services use cookies or similar technologies, their operation may be governed by the relevant provider","’","s policies in addition to Alrazah","’","s own privacy framework."]}),p.jsx("div",{className:"mt-7 grid sm:grid-cols-2 gap-4",children:mC.map(r=>p.jsxs("div",{className:"border border-[#D9D5D2] bg-[#FAF9F7] p-5",children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsx("h3",{className:"text-[15px] font-medium text-[#171717]",children:r.provider}),p.jsx("span",{className:"text-[10px] font-mono tracking-[0.14em] uppercase text-[#8D0034] border border-[#8D0034]/25 px-2 py-0.5",children:r.category})]}),p.jsxs("dl",{className:"grid grid-cols-2 gap-3 text-[13px]",children:[p.jsxs("div",{children:[p.jsx("dt",{className:"text-[10px] font-mono uppercase tracking-[0.14em] text-[#565656]",children:"Service"}),p.jsx("dd",{className:"mt-0.5 text-[#272727]",children:r.service})]}),p.jsxs("div",{children:[p.jsx("dt",{className:"text-[10px] font-mono uppercase tracking-[0.14em] text-[#565656]",children:"Purpose"}),p.jsx("dd",{className:"mt-0.5 text-[#272727]",children:r.purpose})]})]}),p.jsxs("a",{href:"#",className:"mt-4 inline-flex items-center gap-1.5 text-[12.5px] font-medium text-[#8D0034] hover:text-[#650025]",children:["Provider privacy policy ",p.jsx(Qc,{size:12,strokeWidth:1.5})]})]},r.provider))}),p.jsxs("div",{className:"mt-6 grid sm:grid-cols-2 gap-4 max-w-[760px]",children:[p.jsxs("div",{className:"border-l-2 border-[#8D0034] pl-4",children:[p.jsx("h4",{className:"text-[12px] font-mono uppercase tracking-[0.14em] text-[#565656]",children:"First-party"}),p.jsx("p",{className:"mt-1 text-[14px] text-[#272727] leading-relaxed",children:"Technologies placed or controlled by the website operator."})]}),p.jsxs("div",{className:"border-l-2 border-[#D9D5D2] pl-4",children:[p.jsx("h4",{className:"text-[12px] font-mono uppercase tracking-[0.14em] text-[#565656]",children:"Third-party"}),p.jsx("p",{className:"mt-1 text-[14px] text-[#272727] leading-relaxed",children:"Technologies associated with external service providers."})]})]})]})}function yC(){return p.jsxs("section",{children:[p.jsx(wn,{num:"06",id:"retention",children:"Cookie retention"}),p.jsx("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:"Cookies may be retained for different periods depending on their function. Session cookies are deleted when the browser session ends, while persistent cookies remain for a defined period until they expire or are deleted."}),p.jsxs("div",{className:"mt-8 grid sm:grid-cols-2 gap-5 max-w-[760px]",children:[p.jsxs("div",{className:"border border-[#D9D5D2] p-6",children:[p.jsx("span",{className:"text-[11px] font-mono tracking-[0.18em] uppercase text-[#8D0034]",children:"Session"}),p.jsxs("div",{className:"mt-4 space-y-2 font-mono text-[13px] text-[#272727]",children:[p.jsx("p",{children:"├── Browser session"}),p.jsx("p",{children:"└── Deleted when session ends"})]})]}),p.jsxs("div",{className:"border border-[#D9D5D2] p-6",children:[p.jsx("span",{className:"text-[11px] font-mono tracking-[0.18em] uppercase text-[#8D0034]",children:"Persistent"}),p.jsxs("div",{className:"mt-4 space-y-2 font-mono text-[13px] text-[#272727]",children:[p.jsx("p",{children:"├── Defined retention period"}),p.jsx("p",{children:"└── Expires or is deleted earlier"})]})]})]})]})}function vC({onManage:r}){return p.jsxs("section",{children:[p.jsx(wn,{num:"07",id:"managing",children:"Managing your preferences"}),p.jsxs("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:["Where applicable, you may manage your preferences for non-essential cookies through Alrazah","’","s cookie preference centre. Your cookie preferences may also be managed through the cookie consent interface presented when you first access the website."]}),p.jsxs("div",{className:"mt-7 flex flex-wrap items-center gap-4",children:[p.jsxs("button",{onClick:r,className:"inline-flex items-center gap-2 h-11 px-6 bg-[#8D0034] text-white text-[13.5px] font-medium hover:bg-[#650025] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[#8D0034] transition-colors",children:["Manage Cookie Preferences ",p.jsx(un,{size:15,strokeWidth:1.75})]}),p.jsxs("a",{href:"#",className:"inline-flex items-center gap-2 h-11 px-6 border border-[#171717] text-[13.5px] font-medium text-[#171717] hover:bg-[#171717] hover:text-white transition-colors",children:["Review Privacy Policy ",p.jsx(un,{size:15,strokeWidth:1.75})]})]}),p.jsxs("div",{className:"mt-8 bg-[#F5E8ED] border-l-4 border-[#8D0034] p-6 max-w-[760px]",children:[p.jsx("h3",{className:"text-[15px] font-medium text-[#171717]",children:"Your choices matter"}),p.jsx("p",{className:"mt-2 text-[14.5px] leading-[1.8] text-[#272727]",children:"Where consent is required, optional cookies and similar technologies should not be activated until the relevant preference has been provided. Users may revisit their choices through the cookie preference centre at any time."})]})]})}const xC=["Google Chrome","Mozilla Firefox","Apple Safari","Microsoft Edge"];function wC(){return p.jsxs("section",{children:[p.jsx(wn,{num:"08",id:"browser",children:"Browser controls"}),p.jsxs("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:["In addition to Alrazah","’","s preference controls, you may configure your browser to block or delete cookies, restrict third-party cookies, or notify you when cookies are set."]}),p.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:xC.map(r=>p.jsxs("a",{href:"#",className:"inline-flex items-center gap-1.5 border border-[#D9D5D2] px-4 py-2.5 text-[13px] text-[#272727] hover:border-[#8D0034] hover:text-[#8D0034] transition-colors",children:[r," ",p.jsx(Qc,{size:12,strokeWidth:1.5})]},r))})]})}const Fm=[["2.4","11 Aug 2026","Updated cookie categories and inventory"],["2.0","02 Jan 2026","Updated cookie categories"],["1.1","15 Jun 2025","Clarified analytics technologies"],["1.0","10 Jan 2025","Initial publication"]];function EC(){return p.jsxs("section",{children:[p.jsx(wn,{num:"09",id:"updates",children:"Changes to this Cookie Policy"}),p.jsx("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:"Alrazah may update this Cookie Policy from time to time. Material changes may require additional notice. The last-updated date identifies the current version."}),p.jsxs("div",{className:"mt-7 grid sm:grid-cols-2 gap-5 max-w-[760px]",children:[p.jsxs("div",{className:"border border-[#D9D5D2] p-5",children:[p.jsx("span",{className:"text-[10px] font-mono tracking-[0.16em] uppercase text-[#565656]",children:"Current Version"}),p.jsx("p",{className:"mt-1 text-[18px] font-medium text-[#171717]",children:"2.4"})]}),p.jsxs("div",{className:"border border-[#D9D5D2] p-5",children:[p.jsx("span",{className:"text-[10px] font-mono tracking-[0.16em] uppercase text-[#565656]",children:"Last Updated"}),p.jsx("p",{className:"mt-1 text-[18px] font-medium text-[#171717]",children:"11 August 2026"})]})]}),p.jsx("h3",{className:"mt-10 text-[12px] font-mono font-medium tracking-[0.18em] uppercase text-[#565656] mb-4",children:"Version History"}),p.jsx("div",{className:"border border-[#D9D5D2] overflow-x-auto",children:p.jsxs("table",{className:"w-full text-left",children:[p.jsx("thead",{children:p.jsx("tr",{className:"bg-[#F4F2EF]",children:["Version","Date","Description"].map(r=>p.jsx("th",{className:"px-5 py-3 text-[11px] font-mono font-medium tracking-[0.14em] uppercase text-[#565656] border-b border-[#D9D5D2]",children:r},r))})}),p.jsx("tbody",{children:Fm.map((r,t)=>p.jsxs("tr",{className:t!==Fm.length-1?"border-b border-[#D9D5D2]":"",children:[p.jsx("td",{className:"px-5 py-3.5 text-[13px] font-mono text-[#171717]",children:r[0]}),p.jsx("td",{className:"px-5 py-3.5 text-[13px] text-[#565656]",children:r[1]}),p.jsx("td",{className:"px-5 py-3.5 text-[13.5px] text-[#272727]",children:r[2]})]},r[0]))})]})})]})}function bC(){return p.jsxs("section",{children:[p.jsx(wn,{num:"10",id:"contact",children:"Contact"}),p.jsx("p",{className:"mt-5 text-[17px] leading-[1.85] text-[#272727] max-w-[700px]",children:"For questions regarding cookies, digital privacy or this Cookie Policy, contact Alrazah through its official corporate channels."}),p.jsx("div",{className:"mt-7 border border-[#D9D5D2] divide-y divide-[#D9D5D2] max-w-[760px]",children:[["Email","privacy@qprimeholding.com"],["Phone","[+974] XXXX XXXX"],["Address","Doha, State of Qatar"]].map(([r,t])=>p.jsxs("div",{className:"flex items-center justify-between px-5 py-4",children:[p.jsx("span",{className:"text-[11px] font-mono tracking-[0.16em] uppercase text-[#565656]",children:r}),p.jsx("span",{className:"text-[14.5px] font-medium text-[#171717]",children:t})]},r))}),p.jsxs("a",{href:"#",className:"mt-6 inline-flex items-center gap-2 h-11 px-6 bg-[#8D0034] text-white text-[13.5px] font-medium hover:bg-[#650025] transition-colors",children:["Contact Alrazah ",p.jsx(un,{size:15,strokeWidth:1.75})]}),p.jsxs("div",{className:"mt-10 pt-6 border-t border-[#D9D5D2] max-w-[760px]",children:[p.jsx("p",{className:"text-[11px] font-mono tracking-[0.16em] uppercase text-[#565656] mb-3",children:"This policy should be read alongside"}),p.jsx("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:["Privacy Policy","Terms of Use","Legal Disclosures"].map(r=>p.jsxs("a",{href:"#",className:"inline-flex items-center gap-1.5 text-[14px] font-medium text-[#8D0034] hover:text-[#650025]",children:[r," ",p.jsx(un,{size:13,strokeWidth:1.75})]},r))})]})]})}function SC(){return p.jsx("section",{className:"no-print bg-[#4F001D] text-white",children:p.jsx("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8 py-16 lg:py-20",children:p.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 items-center",children:[p.jsxs("div",{className:"lg:col-span-8",children:[p.jsx("span",{className:"text-[11px] font-mono font-medium tracking-[0.2em] uppercase text-white/55",children:"Legal & Digital Privacy"}),p.jsx("h2",{className:"mt-4 font-display text-[30px] lg:text-[38px] leading-[1.15] font-medium tracking-[-0.01em]",children:"Need further information?"}),p.jsx("p",{className:"mt-4 max-w-[560px] text-[16px] leading-[1.8] text-white/75",children:"For questions regarding cookies, digital privacy or this Cookie Policy, contact Alrazah through its official corporate channels."})]}),p.jsxs("div",{className:"lg:col-span-4 flex flex-col gap-3 lg:items-end",children:[p.jsxs("a",{href:"#",className:"inline-flex items-center gap-2 h-12 px-7 bg-white text-[#4F001D] text-[14px] font-medium hover:bg-[#F5E8ED] transition-colors w-full lg:w-auto justify-center",children:["Contact Alrazah ",p.jsx(un,{size:15,strokeWidth:1.75})]}),p.jsxs("a",{href:"#",className:"inline-flex items-center gap-2 h-12 px-7 border border-white/30 text-white text-[14px] font-medium hover:bg-white/10 transition-colors w-full lg:w-auto justify-center",children:["Privacy Policy ",p.jsx(un,{size:15,strokeWidth:1.75})]})]})]})})})}const _C=[{title:"Privacy Policy",desc:"Information about how personal information is handled.",cta:"View Privacy Policy"},{title:"Terms of Use",desc:"Terms governing use of the Alrazah website.",cta:"View Terms of Use"},{title:"Legal Disclosures",desc:"Corporate and legal information.",cta:"View Disclosures"}];function kC(){return p.jsx("section",{className:"no-print bg-[#FAF9F7] border-t border-[#D9D5D2]",children:p.jsxs("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8 py-16",children:[p.jsx("h2",{className:"text-[11px] font-mono font-medium tracking-[0.18em] uppercase text-[#565656] mb-8",children:"Related Legal Information"}),p.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:_C.map(r=>p.jsxs("a",{href:"#",className:"group block border border-[#D9D5D2] bg-white p-7 hover:border-[#8D0034] transition-colors duration-200",children:[p.jsx("h3",{className:"text-[19px] font-medium text-[#171717]",children:r.title}),p.jsx("p",{className:"mt-2.5 text-[14.5px] leading-[1.75] text-[#565656]",children:r.desc}),p.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-[13.5px] font-medium text-[#8D0034] group-hover:gap-2.5 transition-all",children:[r.cta," ",p.jsx(un,{size:14,strokeWidth:1.75})]})]},r.title))})]})})}function CC(){return p.jsx("section",{className:"no-print bg-[#F4F2EF] border-t border-[#D9D5D2]",children:p.jsx("div",{className:"mx-auto max-w-[1240px] px-6 lg:px-8 py-14",children:p.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-6",children:[p.jsxs("div",{className:"max-w-[640px]",children:[p.jsx("span",{className:"text-[11px] font-mono font-medium tracking-[0.2em] uppercase text-[#8D0034]",children:"Alrazah"}),p.jsx("h2",{className:"mt-3 font-display text-[26px] lg:text-[30px] leading-[1.2] font-medium text-[#171717]",children:"Digital transparency is part of corporate responsibility."}),p.jsx("p",{className:"mt-3 text-[15px] leading-[1.75] text-[#565656]",children:"Alrazah is committed to maintaining clear and responsible digital practices across its corporate platforms."})]}),p.jsxs("a",{href:"/",className:"inline-flex items-center gap-2 h-12 px-7 bg-[#8D0034] text-white text-[14px] font-medium hover:bg-[#650025] transition-colors shrink-0",children:["Explore Alrazah ",p.jsx(un,{size:15,strokeWidth:1.75})]})]})})})}const RC=[{key:"necessary",name:"Strictly Necessary",desc:"Essential website functions. Cannot be disabled.",locked:!0},{key:"preferences",name:"Preferences",desc:"Remember user choices and settings.",locked:!1},{key:"analytics",name:"Analytics",desc:"Aggregated website usage understanding.",locked:!1},{key:"functional",name:"Functional & Performance",desc:"Enhanced functionality and reliability.",locked:!1}];function TC({on:r,locked:t,onChange:s,label:o}){return p.jsx("button",{type:"button",role:"switch","aria-checked":r,"aria-label":o,disabled:t,onClick:()=>!t&&s(!r),className:`relative h-7 w-12 shrink-0 transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[#8D0034] ${r?"bg-[#8D0034]":"bg-[#D9D5D2]"} ${t?"opacity-60 cursor-not-allowed":"cursor-pointer"}`,children:p.jsx("span",{className:`absolute top-1 h-5 w-5 bg-white transition-transform duration-200 ${r?"translate-x-6":"translate-x-1"}`})})}function NC({open:r,onClose:t,onSave:s}){const[o,l]=C.useState({necessary:!0,preferences:!1,analytics:!1,functional:!1}),u=C.useRef(null);if(C.useEffect(()=>{if(!r)return;const v=x=>{x.key==="Escape"&&t()};return document.addEventListener("keydown",v),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",v),document.body.style.overflow=""}},[r,t]),!r)return null;const d=(v,x)=>l(k=>({...k,[v]:x})),h=()=>{l({necessary:!0,preferences:!1,analytics:!1,functional:!1}),s("Essential cookies only")},m=()=>{l({necessary:!0,preferences:!0,analytics:!0,functional:!0}),s("All cookies accepted")},g=()=>{const v=["necessary",...Object.keys(o).filter(x=>x!=="necessary"&&o[x])];s(v.length>1?"Preferences saved":"Essential cookies only")};return p.jsxs("div",{className:"fixed inset-0 z-50 flex items-end md:items-center justify-center",children:[p.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),p.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":"Cookie Preferences",className:"relative w-full md:max-w-[680px] bg-white max-h-[92vh] overflow-y-auto",children:[p.jsxs("div",{className:"flex items-center justify-between px-7 py-5 border-b border-[#D9D5D2] sticky top-0 bg-white",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-[19px] font-500 text-[#171717]",children:"Cookie Preferences"}),p.jsx("p",{className:"mt-1 text-[13.5px] text-[#565656]",children:"Select the categories of cookies and similar technologies you wish to allow."})]}),p.jsx("button",{onClick:t,"aria-label":"Close",className:"text-[#565656] hover:text-[#171717] p-1",children:p.jsx(Kc,{size:20,strokeWidth:1.5})})]}),p.jsx("div",{className:"px-7 py-5 divide-y divide-[#D9D5D2]",children:RC.map(v=>p.jsxs("div",{className:"flex items-start justify-between gap-5 py-5",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("h3",{className:"text-[15px] font-medium text-[#171717]",children:v.name}),v.locked&&p.jsx("span",{className:"text-[10px] font-mono tracking-[0.14em] uppercase text-[#8D0034] border border-[#8D0034]/30 px-1.5 py-0.5",children:"Always Active"})]}),p.jsx("p",{className:"mt-1 text-[13.5px] text-[#565656] leading-relaxed max-w-[440px]",children:v.desc})]}),p.jsx(TC,{on:o[v.key],locked:v.locked,label:v.name,onChange:x=>d(v.key,x)})]},v.key))}),p.jsxs("div",{className:"px-7 py-5 border-t border-[#D9D5D2] flex flex-col sm:flex-row gap-3 sticky bottom-0 bg-white",children:[p.jsx("button",{onClick:h,className:"h-11 px-5 border border-[#171717] text-[13.5px] font-medium text-[#171717] hover:bg-[#171717] hover:text-white transition-colors",children:"Reject Non-Essential"}),p.jsx("div",{className:"flex-1"}),p.jsx("button",{onClick:m,className:"h-11 px-5 border border-[#8D0034] text-[#8D0034] text-[13.5px] font-medium hover:bg-[#F5E8ED] transition-colors",children:"Accept All"}),p.jsx("button",{onClick:g,className:"h-11 px-6 bg-[#8D0034] text-white text-[13.5px] font-medium hover:bg-[#650025] transition-colors",children:"Save Preferences"})]})]})]})}function PC(){const[r,t]=C.useState(!1),[s,o]=C.useState(null),l=u=>{o(u),t(!1)};return p.jsxs("div",{className:"min-h-screen bg-[#FAF9F7] font-body text-[#171717]",children:[p.jsx(Jk,{}),p.jsx(eC,{}),p.jsx(rC,{}),p.jsx(sC,{}),p.jsx(iC,{}),p.jsx(aC,{onManage:()=>t(!0),consentStatus:s}),p.jsx("main",{id:"content",className:"mx-auto max-w-[1240px] px-6 lg:px-8 py-16 lg:py-24",children:p.jsxs("div",{className:"grid lg:grid-cols-12 gap-10 lg:gap-14",children:[p.jsx("div",{className:"lg:col-span-3",children:p.jsx(lC,{})}),p.jsxs("div",{className:"lg:col-span-9 space-y-20",children:[p.jsx(cC,{}),p.jsx(fC,{}),p.jsx(pC,{}),p.jsx(gC,{}),p.jsx(yC,{}),p.jsx(vC,{onManage:()=>t(!0)}),p.jsx(wC,{}),p.jsx(EC,{}),p.jsx(bC,{})]})]})}),p.jsx(SC,{}),p.jsx(kC,{}),p.jsx(CC,{}),p.jsx(nC,{}),p.jsx(NC,{open:r,onClose:()=>t(!1),onSave:l})]})}const OC=()=>{const{isLoadingAuth:r,isLoadingPublicSettings:t,authError:s,navigateToLogin:o}=Kk();if(t||r)return p.jsx("div",{className:"fixed inset-0 flex items-center justify-center",children:p.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-slate-800 rounded-full animate-spin"})});if(s){if(s.type==="user_not_registered")return p.jsx(Gk,{});if(s.type==="auth_required")return o(),null}return p.jsxs(KE,{children:[p.jsx(Cc,{path:"/legal/cookie-policy/",element:p.jsx(PC,{})}),p.jsx(Cc,{path:"*",element:p.jsx(Hk,{})})]})};function AC(){return p.jsx(Qk,{children:p.jsxs(G1,{client:lE,children:[p.jsxs(YE,{children:[p.jsx(Yk,{}),p.jsx(OC,{})]}),p.jsx(S1,{})]})})}cx.createRoot(document.getElementById("root")).render(p.jsx(AC,{}));